lucene.net

NHibernate.Search Index Rebuild

柔情痞子 提交于 2019-12-11 03:09:56
问题 How can i rebuild Lucene.NET Index using NHibernate.Search ? Thanks. 回答1: There is an Index method off of the IFullTextSearchSession that will force and index of an entity. So you just need to retrieve all of the objects and then call index on them. 回答2: Here is an example: public void Index(List<object> entities, ISession s) { using (var search = NHibernate.Search.Search.CreateFullTextSession(s)) { foreach (var entity in entities) { using (var tx = s.BeginTransaction()) { search.Index(entity

SpatialQuery for location based search using Lucene

别来无恙 提交于 2019-12-11 01:46:29
问题 My lucene index has got latitude and longitudes fields indexed as follows: doc.Add(new Field("latitude", latitude.ToString() , Field.Store.YES, Field.Index.UN_TOKENIZED)); doc.Add(new Field("longitude", longitude.ToString(), Field.Store.YES, Field.Index.UN_TOKENIZED)); I want to retrieve a set of documents from this index whose lat and long values are in a given range. As you already know, Lat and long could be negative values. How do i correctly store signed decimal numbers in Lucene? Would

Building Examine (lucene.net) index with comma separated list of IDs

你。 提交于 2019-12-11 01:05:04
问题 I have an Umbraco website that is using Examine search which is based on lucene.net. I am pretty much trying to do exactly what is described in the following article: Querying against a comma separated list of IDs with Examine and Lucene.Net? The problem I have is when I am trying to create the index using the following code: // Loop through articles foreach (var a in articles) { yield return new SimpleDataSet() { NodeDefinition = new Examine.IndexedNode() { NodeId = a.Id, Type = "Article" },

No hits when searching for “mvc2” with lucene.net

痞子三分冷 提交于 2019-12-10 22:47:35
问题 I am indexing and searching with lucene.net, the only problem I am having with my code is that it does not find any hits when searching for "mvc2"(it seems to work with all the other words I search), I have tried a different analyzer(see comments by analyzer) and older lucene code, here is my index and search code, I would really appreciate if someone can show me where I am going wrong with this, Thanks. ////Indexing code public void DoIndexing(string CvContent) { //state the file location of

Lucene.Net 3.0.3 Spatial search

两盒软妹~` 提交于 2019-12-10 18:49:26
问题 I am a newcomer to Lucene.Net. I started trying to use spatial searches with Lucene.Net 3.0.3 release. Could someone have a simple demo project that can help me to understand how it works? Thank you, that would be very appreciated. 回答1: Just got spatial search working today. Below is the core SearchByLocation method: public IList<SearchItem> SearchByLocation(string queryString, double longitude, double latitude, double searchRadiusKm, int maxHits = 10) { IList<SearchItem> results; using (var

Singleton pattern for IndexWriter and IndexSearcher Lucene.net

我的梦境 提交于 2019-12-10 17:06:47
问题 I'm using Lucene.net 3.0.3.0 (the latest version right now). I would like to know if using a single instance of IndexWriter and IndexSearcher is a good choice in production environment(considering thread safety). I read in the documentation that creating new objects of these instances is an expensive operation and internally lucene handles concurrent requests pretty well. This is a question to the people who have used lucene.net in production environment; please let me know if this will work

Can I use the same instance of IndexSearcher in Lucene.Net by multiple threads concurrently?

蓝咒 提交于 2019-12-10 17:04:59
问题 I want to be able to search by multiple clients and index at the same time in Lucene.Net Is it possible and thread safe? Can the same instance of IndexSearcher be shared across threads? 回答1: The index search CAN and SHOULD be shared across threads. The trick is deciding when to refresh your searcher with a new snapshot of the index. I wrote an article showing how I coded sharing a searcher across threads while at the same time making sure that the searcher was always using an up-to-date index

Condition to check whether document exists in Index (Lucene.NET)

耗尽温柔 提交于 2019-12-10 15:48:55
问题 I am using Lucene.NET and I would like to check before whether a document is contained in the index, so that if it is, I do not need to store it in the index, but I can skip it. I've read some questions that had the same problem, but they all dealt with deleting and updating it with the new document. I don't want to have to do that since the document will contain the exact same data and it would be useless to store it again. I have a field that acts as an ID called URL where each document

how to do fuzzy search in Lucene.net in asp.net?

不想你离开。 提交于 2019-12-10 15:46:16
问题 we have creating lucene.net index and search based on this URL http://sonyblogpost.blogspot.in/. but we want the output like follow. example: if i search "featured" i want to show related terms like "featured","featuring","feature". Anyone can help me. thanks. 回答1: To perform a Fuzzy search you'll create a MultiFieldQueryParser Below is an example on how to do this: var parser = new MultiFieldQueryParser(Lucene.Net.Util.Version.LUCENE_29, new[] { "field1", "field2" }, new StandardAnalyzer

lucene.net sort not working access violation

给你一囗甜甜゛ 提交于 2019-12-10 15:28:23
问题 I am trying to sort my results in lucene I keep getting this error however An unhandled exception of type 'System.AccessViolationException' occurred in Search.dll Additional information: Attempted to read or write protected memory. This is often an indication that other memory is corrupt. I have tried setting Field.Index to analysed and not analysed but no joy. Analyzer analyzer = new StandardAnalyzer(Lucene.Net.Util.Version.LUCENE_29); var parser = new QueryParser(Lucene.Net.Util.Version