lucene-general mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From KingKory <>
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 <> 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

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

Thanks again,
View this message in context:
Sent from the Lucene - General mailing list archive at

View raw message