lucene.net

How to implement Lucene .Net search on Azure webrole

送分小仙女□ 提交于 2019-12-02 08:33:54
问题 I'm using AzureDirectory and Lucene .NET 2.9.4 but I have wo problems: searcher doesn't seems to be so fast. I'm indexing with these settings: indexWriter.SetUseCompoundFile(false); indexWriter.SetMergeFactor(1000); index is around 3.5gb and it has 12.126.436 docs. To create the indexSearcher it takes around 5 min or more even if index is already on local disk. Is the index too big? I tried to perform a single term search using MultiFieldQueryParser on two fields. TermVector on fields is off

Using BooleanQuery or write more indexes?

给你一囗甜甜゛ 提交于 2019-12-02 07:35:46
A category tree like this: root_1 sub_1 sub_2 ... to sub_20 Every document has a sub category(like sub_2 ). Now, I only wrote sub_2 in lucene index: new NumericField("category",...).setIntValue(sub_2.getID()); I want to get all root_1 's documents, using BooleanQuery (merge the sub_1 to sub_20 ) to search or write an other category in every entry document: new NumericField("category",...).setIntValue(sub_2.getID()); new NumericField("category",...).setIntValue(root_1.getID());//sub_2's ancestor category Which is the better choice? Mark Leighton Fisher I would use a path enumeration/'Dewey

MultiFieldQueryParser is removing dots from the acronym

旧街凉风 提交于 2019-12-02 07:35:16
Am posting this question again as my query is not answered. Am working on a book search api using Lucene. User can search for a book whose title or description field contains C.F.A... Am using StandardAnalyzer alongwith a list of stop words. Am using MultiFieldQueryParser for parsing above string.But after parsing, its removing the dots in the string. What am i missing here? Thanks. itsadok As you mentioned, this is a dupe of this question . I suggest you at least add a link to it in your question. Also, I would urge you to create a user account, since right now it's not possible to look at

FieldCache with frequently updating index

那年仲夏 提交于 2019-12-02 05:17:21
问题 Hi I have lucene index that is frequently updating with new records, I have 5,000,000 records in my index and I'm caching one of my numeric fields using FieldCache. but after updating index it takes time to reload the FieldCache again (im reloading the cache cause documentation said DocID is not reliable) so how can I minimize this overhead by adding only newly added DocIDs to the FieldCache, cause this capability turns to bottleneck in my application. IndexReader reader = IndexReader.Open

How to implement Lucene .Net search on Azure webrole

半世苍凉 提交于 2019-12-02 04:12:26
I'm using AzureDirectory and Lucene .NET 2.9.4 but I have wo problems: searcher doesn't seems to be so fast. I'm indexing with these settings: indexWriter.SetUseCompoundFile(false); indexWriter.SetMergeFactor(1000); index is around 3.5gb and it has 12.126.436 docs. To create the indexSearcher it takes around 5 min or more even if index is already on local disk. Is the index too big? I tried to perform a single term search using MultiFieldQueryParser on two fields. TermVector on fields is off Everywhere is suggested to create only an instance of indexSearcher and share it between queries (in

How to improve a single character PrefixQuery performance?

非 Y 不嫁゛ 提交于 2019-12-01 23:48:24
I have a RAMDirectory with 1.5 million documents and I'm searching using a PrefixQuery for a single field. When the search text has a length of 3 or more characters, the search is extremely fast, less than 20 milliseconds. But when the search text has a length of less than 3 characters, the search might take even a full 1 second. Since it's an auto complete feature and the user starts with one character (and there are results that are indeed 1 char length), I cannot restrict the length of the search text. The code is pretty much: var symbolCodeTopDocs = searcher.Search(new PrefixQuery(new Term

Getting the Doc ID in Lucene

时光总嘲笑我的痴心妄想 提交于 2019-12-01 22:32:05
In lucene, I can do the following doc.GetField("mycustomfield").StringValue(); This retrieves the value of a column in an index's document. My question, for the same 'doc' , is there a way to get the Doc. Id ? Luke displays it hence there must be a way to figure this out. I need it to delete documents on updates. I scoured the docs but have not found the term to use in GetField or if there already is another method. Turns out you have to do this: var hits = searcher.Search(query); var result = hits.Id(0); As opposed to var results = hits.Doc(i); var docid = results.<...> //there's nothing I

Delete all indices in Lucene.net

故事扮演 提交于 2019-12-01 16:39:29
I want to delete all the previously created indices. I am using Lucene.net . I tried the following: Term term = new Term(); //empty because I want to delete all the indices IndexReader rdr = IndexReader.Open(_directory); rdr.DeleteDocuments(term); rdr.Close(); But I get error. Any idea how to go about it? The best way to delete an index is to wipe the filesystem directory. However, if you wan't to regenerate the index, the easiest way is to open a new indexwriter with the create parameter as true. It will start a new index deleting the contents of the existing one. although the thread is old i

Where has Lucene.Net.Highlight gone?

非 Y 不嫁゛ 提交于 2019-12-01 15:47:13
I'm trying to figure out where Lucene.Net.Highlight.dll and the corresponding formatting classes (such as SimpleHTMLFormatter ) have gone to. The last time I downloaded Lucene.Net this assembly was packaged up in the zip file, however this isn't the case with the latest download I could find and I couldn't find any other references to it on this page , or any other page for that matter. Does anyone know where it is hiding? There is no binary releases of the recent Lucene.Net versions. You will have to check it out from : https://svn.apache.org/repos/asf/lucene/lucene.net/trunk/C#/contrib

How to create facets with Lucene.Net

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-01 14:38:40
I am building a C# windows form application that searches a database and displaying the results. I am trying to find a guide on how to create facets with Lucene but it seems that I can't. I am creating the index and I am able to search a database but I want to create facets for the results. Is there any guide or a project to use as example? EDIT here's the link to my project so far https://github.com/assignment128A-adopse/Assignment any help/suggestion would be helpful There are a few options. Option #1 In Lucene.Net 4.8.0, you can use the Lucene.Net.Facet module to setup faceted search. See