lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KingKory <cbkpr...@gmail.com>
Subject Re: Lucene.NET Integration
Date Tue, 26 May 2009 22:05:40 GMT


Ted Dunning wrote:
> 
> Yes.
> 
> If you want a term with a space in the middle, you need to have a special
> purpose analyzer and likely won't be able to use the normal query parser.
> 
> On Tue, May 26, 2009 at 2:00 PM, KingKory <cbkprice@gmail.com> wrote:
> 
>> Are you saying that [abcd efgh] is read by Lucene as [abcd] OR [efgh]?
>> Space
>> characters are read as an OR operator?
>>
> 
> 
Ted, thanks again.

If I used something like this to instantiate my parser:

Dim searcher As New Lucene.Net.Search.IndexSearcher("C:\SearchIndex")

'Dim query As Lucene.Net.Search.Query
'query = Lucene.Net.QueryParsers.QueryParser.Parse(mySearchQuery, "content",
New Lucene.Net.Analysis.Standard.StandardAnalyzer)
Dim query As New Lucene.Net.Search.FuzzyQuery(New
Lucene.Net.Index.Term("content", "~" & mySearchQuery & "~"), 0.35, 0)

Dim hits As Lucene.Net.Search.Hits
hits = searcher.Search(query)

'Loop through hits, and display as web page. 

Would it be more successful?

Browsing through a few Lucene tutorials, it says one major pitfall is that
the Analyzers used to Index and Search are not the same. Using the
"FuzzyQuery" method, we are not able to specify an Analyzer.

However, the IndexWriter constructor has no variants where an Analyzer
parameter is not required, so I believe I would be falling into this
pitfall.

Will you please elaborate on the "Special Purpose Analyzer"? Are these
included with the standard Lucene API?

Thanks again,
-- 
View this message in context: http://www.nabble.com/Lucene.NET-Integration-tp23731090p23732277.html
Sent from the Lucene - General mailing list archive at Nabble.com.


Mime
View raw message