lucenenet-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neal Granroth (JIRA)" <j...@apache.org>
Subject [jira] Commented: (LUCENENET-385) Searching string with Special charactor not working
Date Fri, 17 Dec 2010 18:22:05 GMT

    [ https://issues.apache.org/jira/browse/LUCENENET-385?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12972573#action_12972573
] 

Neal Granroth commented on LUCENENET-385:
-----------------------------------------

This problem exists in Lucene 2.2 and older (see LUCENE-881).
Escape characters work properly in the current Lucene.NET ( 2.9.2 )

> Searching string with Special charactor not working
> ---------------------------------------------------
>
>                 Key: LUCENENET-385
>                 URL: https://issues.apache.org/jira/browse/LUCENENET-385
>             Project: Lucene.Net
>          Issue Type: Task
>         Environment: .NET Framework 2.0+, C#.NET, ASP.NET, Webservices
>            Reporter: Abhilash C R
>
> I have came acroos an issue with search option in our application which uses Lucene.Net
2.0 version. 
> The scenario is if I try search a text "Test&&Test" (it is actually Test&&Test.doc,
which is trying to search), it returns 0 hits. While debugging I could see that the line which
wrote to Parse the query is giving the problem,
> Here is the error line code:
> Query
> q=null; 
> q = 
> new global::Lucene.Net.QueryParsers.QueryParser("content", new StandardAnalyzer()).Parse(query);

>  The variable query at above point contains as this: 
> (title:(Test&&Test) shorttitle:(Test&&Test) content:(Test&&Test)
keywords:(Test&&Test) description:(Test&&Test) )
> and q will get as this:
> title:"test test" shorttitle:"test test" content:"test test" keywords:"test test" description:"test
test"
>  
> And hence the hit length will be 0 at 
> IndexSearcher searcher = new IndexSearcher(indexPath); 
> Hits hits = searcher.Search(q);
> I tried adding"\" before &&, tried escape, tried enclosing the text in a "" but
all result the same outcome.
> Could anyone please hlep me with any fix to it?
> If require I can post the full code here.
> Hope to hear from Lucene.Net.
> Many thanks
> Abhilash 

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.


Mime
View raw message