lucene-general mailing list archives

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

Good afternoon,

We are trying to integrate Lucene into our web search functionality.

Indexing:

Dim LuceneIndex = New Lucene.Net.Index.IndexWriter("C:\SearchIndex", New
Lucene.Net.Analysis.Standard.StandardAnalyzer, True)

'For each webpage-
Dim LuceneDoc As New Lucene.Net.Documents.Document

'v_WebPageContent contains keywords, description, etc.
LuceneDoc .Add(Lucene.Net.Documents.Field.Text("content", v_WebPageContent)) 
LuceneDoc .Add(Lucene.Net.Documents.Field.Text("url", v_WebPageURL))
LuceneDoc .Add(Lucene.Net.Documents.Field.Text("title", v_WebPageTitle))

LuceneIndex.AddDocument(LuceneDocument)

Searching:

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 hits As Lucene.Net.Search.Hits
hits = searcher.Search(query)

'Loop through hits, and display as web page.

Results:

I've verified that my Lucene documents are being created, and that the
"content" field is being populated. I believe the issue lies in the
Searching.

My results are erratic: 

1. A keyword on one page will hit, while the same keyword on another page
will not.
2. "abcd efgh" will return 100 hits, but "efgh" will return 50 hits. The
expected result is that "efgh" will return at least 100 hits.

--

Thank you in advance.
-- 
View this message in context: http://www.nabble.com/Lucene.NET-Integration-tp23731090p23731090.html
Sent from the Lucene - General mailing list archive at Nabble.com.


Mime
View raw message