lucene.net

Configure Lucene.Net with SQL Server

非 Y 不嫁゛ 提交于 2020-01-08 18:20:29
问题 Has anyone used Lucene.NET rather than using the full text search that comes with sql server? If so I would be interested on how you implemented it. Did you for example write a windows service that queried the database every hour then saved the results to the lucene.net index? 回答1: Yes, I've used it for exactly what you are describing. We had two services - one for read, and one for write, but only because we had multiple readers. I'm sure we could have done it with just one service (the

“Shuffling” a Lucene Hits result set

£可爱£侵袭症+ 提交于 2020-01-07 08:10:10
问题 I have the following program: public class Hit { readonly Hits _hits; readonly int _index; public Hit(Hits hits, int index) { this._hits = hits; this._index = index; } public int id { get { return _hits.Id(_index); } } public float score { get { return _hits.Score(_index); } } public string this[string key] { get { return _hits.Doc(_index).Get(key); } } } class HitList : IList<Hit> { protected Hits hits; public HitList(Hits hits) { this.hits = hits; } #region IList Members public int Add

Use AzureDirectory with Lucene.NET 3.0.3.0

本小妞迷上赌 提交于 2020-01-04 07:53:10
问题 I download AzureDirectory and with latest Lucene.NET Simply cannot compile Lots of error like 'Lucene.Net.Store.Azure.AzureDirectory' does not implement inherited abstract member 'Lucene.Net.Store.Directory.Dispose(bool)' Is there any new AzureDirectory that can work with the Lucene 3? 回答1: I have tested the Lucene.Net.Store.Azure 1.0.5.1 with Lucene.Net 3.0.3 which worked for me. I used the following steps so you can try as well: Created a Windows Azure Worker Role in VS2010 Included Lucene

Multiple Indexes search in Lucene.Net

£可爱£侵袭症+ 提交于 2020-01-03 09:11:33
问题 I have multiple lucene.net indexes that I would need to search on for a query string. So will I need to open a new IndexSearcher on all these indexes or can I achieve this with a single IndexSearcher? Thanks 回答1: It can be accomplished using the MultiSearcher. It implements the Searchable interface over multiple subsearchers. If you only need methods from the Searchable interface it will be just like a regular IndexSearcher to you. If you need to access the underlying searchers that found a

Lucene.net 2.9.2 NumericField sort

淺唱寂寞╮ 提交于 2020-01-03 06:28:41
问题 Can anyone verify if the latest Lucene.net 2.9.2 can sort (and reverse sort) NumericField? I am sort of stumped, expecially with the reverse sort :( 回答1: I also get into the same problem today, the below code is working after troubleshooting for some time. TopDocs matches = searcher.Search(query, null, 10, new Sort(new SortField("id", SortField.INT, true))); This is important SortField.INT , otherwise the sorting in the integer field is not working. 来源: https://stackoverflow.com/questions

Lucene.net contains only last added document

守給你的承諾、 提交于 2020-01-03 05:56:07
问题 It's a weird problem but every time I add a new document to Lucene.net it overrides the last one and thus it always holds the last inserted document. I've confirmed this behavior using LUKE which lets me open the index files. I'd appreciate if someone could shed light on the problem. Here is my code: public class SearchService : ISearchService { Directory indexFileLocation; Analyzer analyzer; public SearchService(String indexLocation) { indexFileLocation = FSDirectory.GetDirectory

Maximum boost factor

天涯浪子 提交于 2020-01-02 08:11:44
问题 What is the maxiimum boost factor value for a word in Lucene.Net? I believe default value is 1.0f Thanks! 回答1: It can be any positive number. Of course, if you pick an unreasonable number, like Float.POSITIVE_INFINITY (or the .NET equivalent), you'll end up with some crazy scores. Generally, you want to look at your boosts as a percentage: 1.0F is 100%, meaning no boost up or down. 1.2F is 120%, a little boost up; 0.5 is 50%, a fairly significant boost down. 回答2: I've found evidence on Google

Maximum boost factor

北战南征 提交于 2020-01-02 08:11:33
问题 What is the maxiimum boost factor value for a word in Lucene.Net? I believe default value is 1.0f Thanks! 回答1: It can be any positive number. Of course, if you pick an unreasonable number, like Float.POSITIVE_INFINITY (or the .NET equivalent), you'll end up with some crazy scores. Generally, you want to look at your boosts as a percentage: 1.0F is 100%, meaning no boost up or down. 1.2F is 120%, a little boost up; 0.5 is 50%, a fairly significant boost down. 回答2: I've found evidence on Google

How do I load balance Lucene.Net?

[亡魂溺海] 提交于 2020-01-02 07:53:48
问题 Is it possible to load balance a Lucene.NET index across multiple processes / servers? Since Lucene.NET is filebased is it possible to just make a simple filecopy (using i.e. robocopy) of the index to the servers serving queries? 回答1: Yes, this is possible, no problems to be expected here if you are really only reading / searching the index. 来源: https://stackoverflow.com/questions/304934/how-do-i-load-balance-lucene-net

Lucene - searching for a numeric value field

你离开我真会死。 提交于 2020-01-02 03:30:30
问题 ok, i have searched for this in the past two hours with results that only give's tips, and not even one complete code to the rescue ( how would noobs learn if they cant see some samples ? ) i have created an index like so: Directory directory = FSDirectory.Open(new System.IO.DirectoryInfo(Server.MapPath("/data/channels/"))); Analyzer analyzer = new StandardAnalyzer(Version.LUCENE_29); IndexWriter writer = new IndexWriter(directory, analyzer, true, Lucene.Net.Index.IndexWriter.MaxFieldLength