lucene.net

Infamous: Invalid index n for this SqlParameterCollection with Count=

别来无恙 提交于 2019-12-03 23:17:34
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.SqlParameterCollection.RangeCheck(Int32 index) at System.Data.SqlClient.SqlParameterCollection

understanding the relationship between boosting a document in lucene at index time and its corresponding score at search time

末鹿安然 提交于 2019-12-03 22:08:08
问题 When indexing, I boost certain documents, but they do not appear on the top of the list of retrieved documents. I looked at the score of those documents, and somehow, the score of the documents retrieved is always NaN. What is the relationship between a boost of a document at index time and its score at retrieve time? I thought these would be correlated, and further, I thought I would get a wide range of scores in my scoredocs, not just NaN. If you can shed some light on this I would be

Need to know pros and cons of using RAMDirectory

|▌冷眼眸甩不掉的悲伤 提交于 2019-12-03 17:39:08
问题 I need to improve performance of my Lucene search query. Can I use RAMDirectory?Does it optimize performance?Is there any index size limit for this? I would appreciate if someone could list pros and cons of using a RAMDirectory. Thanks. 回答1: I compare FSDirectory and RAMDirectory. index size is 1.4G Centos, 5G memory Search 1000 keywords, the average/min/max response time (ms) is here FSDirectory first run: 351/7/2611 second run: 47/7/837 third run(restart app): 53/7/2343 RAMDirectory first

How to add documents in Lucene.Net.Linq?

China☆狼群 提交于 2019-12-03 16:13:55
The Lucene.Net.Linq project seems pretty powerful and while querying seems pretty simple, I'm not quite sure how to add/update documents. Can an example or two be provided? There are some full examples in the test project at https://github.com/themotleyfool/Lucene.Net.Linq/tree/master/source/Lucene.Net.Linq.Tests/Samples . Once you've configured your mappings and initialized your provider, you make updates by opening a session: var directory = new RAMDirectory(); var provider = new LuceneDataProvider(directory, Version.LUCENE_30); using (var session = provider.OpenSession<Article>()) { session

How do I perform an AND search in Lucene.net when multiple words are used in a search?

梦想与她 提交于 2019-12-03 14:38:06
I am playing around with Lucene.net to try and get a handle of how to implement it in my application. I have the following code ..... // Add 2 documents var doc1 = new Document(); var doc2 = new Document(); doc1.Add(new Field("id", "doc1", Field.Store.YES, Field.Index.ANALYZED)); doc1.Add(new Field("content", "This is my first document", Field.Store.YES, Field.Index.ANALYZED)); doc2.Add(new Field("id", "doc2", Field.Store.YES, Field.Index.ANALYZED)); doc2.Add(new Field("content", "The big red fox jumped", Field.Store.YES, Field.Index.ANALYZED)); writer.AddDocument(doc1); writer.AddDocument

lucene.net combine multiple filters and no search terms

穿精又带淫゛_ 提交于 2019-12-03 13:49:44
How can I do a Filter across multiple fields in Lucene.Net? On one field I simply do: TermQuery tool = new TermQuery(new Term("Tool", "Nail")); Filter f = new QueryFilter(tool); If I now wanted to add a nail length to the filter, how can I do that? Also, I want the user to be a able to do a search with no search term (i.e. by just choosing a category) how can I do that? I think you're asking two questions... Question 1: Adding an additional filter Remember, QueryFilter accepts any query (not just TermQuery ). Therefore, you can create a BooleanQuery of the criteria you wish to filter on.

Directory lock error with Lucene.Net usage in an ASP.NET MVC site

雨燕双飞 提交于 2019-12-03 12:05:46
I'm building an ASP.NET MVC site where I want to use Lucene.Net for search. I've already built a SearchController and all of its methods, but I'm getting an error at runtime that occurs when the SearchController is first initialized. In SearchController, here's how I'm creating an IndexWriter: public static string IndexLocation = HostingEnvironment.MapPath("~/lucene"); public static Lucene.Net.Analysis.Standard.StandardAnalyzer analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(); public static IndexWriter writer = new IndexWriter(IndexLocation,analyzer); The error occurs on the last

Avoid removal of current Lucene.NET index during rebuild

廉价感情. 提交于 2019-12-03 09:19:21
问题 I'm new to Lucene.NET but I'm using an open source tool built for Sitecore CMS that uses Lucene.NET to index lots of content from the CMS. I confirmed yesterday that when I rebuild my indexes, the current index files wipe clean so anything that relies on the index gets no data for about 30-60 seconds (the amount of time for a full index rebuild). Is there a best practice or way to make Lucene.NET not overwrite the current index files until the new index is completely rebuilt? I'm basically

Fluent nhibernate + nhibernate.serach + lucene.net

寵の児 提交于 2019-12-03 09:05:35
can someone tell me how to use nhibernate serach and lucene with fluent nhibernate. I have my application writen with fluent nhibernate but now i need full text serach but do not know how to implmenet nhibernate search with lucene to fluent nhibernate. i found this but it is not much and do not know how to use it: Fluent NHibernate + Lucene Search (NHibernate.Search) thx in advanced Lucene.net is a self-contained search and directory utility. As far as I know it cannot be integrated with nhibernate by mappings only. You should implement adding data to lucene index by yourself. Lucene allows to

How might I index PDF files using Lucene.Net?

心已入冬 提交于 2019-12-03 08:51:14
问题 I'm looking for some sample code demonstrating how to index PDF documents using Lucene.Net and C#. Google turned up a few, but none that I could find helpful. 回答1: From my understanding, Lucene is limited to creating an index and searching that index. It's up to the application to handle opening files and extracting their contents for the index. So if you're looking to search PDF documents you'll want to use something like iTextSharp to open the file, pull out the contents, and pass it to