lucene.net

Lucene.NET through NHibernate.Search and POCO Entities

荒凉一梦 提交于 2019-12-22 01:28:18
问题 Is there anyway to keep true POCO Entities while working with Lucene.NET through NHibernate.Search ? It seems that Lucene.NET (NHibernate.Search) mapping only work with Attributes within Entity classes. 回答1: Actually this was true, not too long ago. However, there are different mapping providers out there. Take a look into the source code for the Mapping namespace. You will have to build your own provider but it is possible. 来源: https://stackoverflow.com/questions/2356593/lucene-net-through

Lucene Search for documents that have a particular field?

感情迁移 提交于 2019-12-21 20:14:45
问题 Lucene.Net - Is there a way to query for documents that contain a particular field. Lets say some of my documents have a field 'foo' and some do not. I want to find all documents that have the field 'foo' - regardless of what the value of foo is. How do I do this? Is it some sort of TermQuery? 回答1: Try foo:[* TO *] should work for all non-null values of field 'foo' 来源: https://stackoverflow.com/questions/2686033/lucene-search-for-documents-that-have-a-particular-field

Getting terms matched in a document when searching using a wildcard search

只谈情不闲聊 提交于 2019-12-21 09:11:08
问题 I am looking for a way to find the terms that matched in the document using waldcard search in Lucene. I used the explainer to try and find the terms but this failed. A portion of the relevant code is below. ScoreDoc[] myHits = myTopDocs.scoreDocs; int hitsCount = myHits.Length; for (int myCounter = 0; myCounter < hitsCount; myCounter++) { Document doc = searcher.Doc(myHits[myCounter].doc); Explanation explanation = searcher.Explain(myQuery, myCounter); string myExplanation = explanation

Infamous: Invalid index n for this SqlParameterCollection with Count=

对着背影说爱祢 提交于 2019-12-21 07:23:30
问题 This exception: Invalid index n for this SqlParameterCollection with Count= Usually points at duplicate mapping information (see Stack Overflow + Google). I am pretty sure I have none. Are there any other reasons for it? I seem to have identified the problem. I introduced this: [DocumentId] public virtual int GI { get { return base.Id; } protected set { base.Id = value; } } To use search via lucene.net. This seems to interfere with FNH! What are my options here? PS: at System.Data.SqlClient

Storing relational data in a Lucene.NET index

折月煮酒 提交于 2019-12-21 04:39:29
问题 I'm currently trying to implement a Lucene.NET based search on a large database and I've hit a snag trying to do a search on what is essentially relational data. At a high level the data I'm trying to search is grouped, each item belongs to 1 to 3 groups. I then need to be able to do a search for all items that are in a combination of groups (EG: Each item belongs to both group A and group B). Each of these groupings have ID's and Descriptions existing from the data I'm searching, but the

Lucene IndexWriter slow to add documents

荒凉一梦 提交于 2019-12-21 01:58:31
问题 I wrote a small loop which added 10,000 documents into the IndexWriter and it took for ever to do it. Is there another way to index large volumes of documents? I ask because when this goes live it has to load in 15,000 records. The other question is how do I prevent having to load in all the records again when the web application is restarted? Edit Here is the code i used; for (int t = 0; t < 10000; t++){ doc = new Document(); text = "Value" + t.toString(); doc.Add(new Field("Value", text,

Are there any books on Lucene.NET [closed]

孤人 提交于 2019-12-20 12:29:06
问题 Closed. This question is off-topic. It is not currently accepting answers. Want to improve this question? Update the question so it's on-topic for Stack Overflow. Closed 4 years ago . I have searched on amazon and could not find a book on lucene.net. Have you guys came across a decent book on lucene.net? 回答1: You may want to look at: Lucene In Action. Since Lucene.NET is a .NET port of the project, you may find it covers the necessary concepts, even though it's for Java. There should be a 2nd

Lucene.Net/SpellChecker - multi-word/phrase based auto-suggest

微笑、不失礼 提交于 2019-12-20 10:57:52
问题 I've implemented Lucenet.NET on my site, using it to index my products which are theatre shows, tours and attractions around London. I want to implement a "Did you mean?" feature for when users misspell product names that takes the whole product titles into account and not just single words. For example, If the user typed: Lodnon Eye I would like to auto-suggest: London London Eye I assume I nead to have the analyzer index the titles as if they are a single entity, so that SpellChecker can

Paging using Lucene.net

强颜欢笑 提交于 2019-12-20 10:07:20
问题 I'm working on a .Net application which uses Asp.net 3.5 and Lucene.Net I am showing search results given by Lucene.Net in an asp.net datagrid. I need to implement Paging (10 records on each page) for this aspx page. How do I get this done using Lucene.Net? 回答1: Here is a way to build a simple list matching a specific page with Lucene.Net. This is not ASP.Net specific. int first = 0, last = 9; // TODO: Set first and last to correct values according to page number and size Searcher searcher =

Lucene Search Syntax

狂风中的少年 提交于 2019-12-20 05:38:12
问题 I need help figuring out which query types to use in given situations. I think i'm right in saying that if i stored the word "FORD" in a lucene Field and i wanted to find an exact match i would use a TermQuery ? But which query type should i use if I was looking for the word "FORD" where the contents of the field where stored as :- "FORD|HONDA|SUZUKI" What if i was to search the contents of an entire page, looking for a phrase? such as "please help me"? 回答1: If you want to search FORD in FORD