lucene.net

Lucene.NET indexes are not updating when dealing with many-to-many relationships using NHibernate.Search

无人久伴 提交于 2020-01-01 19:38:10
问题 I have integrated NHibernate.Search into my web app by following tutorials from the following sources: NHibernate.Search using Lucene.NET Full Text Index (Part 1) Using NHibernate.Search with ActiveRecord I have also successfully batch-indexed my database, and when testing against Luke, I can search for terms that reside in whatever entities I marked as indexable. However , when I attempt to update many-to-many entities via my web app, my parent index does not seem to update. For example:

Getting the Doc ID in Lucene

房东的猫 提交于 2019-12-31 01:56:06
问题 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. 回答1: Turns out you have to do this: var hits = searcher.Search(query); var

Delete all indices in Lucene.net

痴心易碎 提交于 2019-12-30 18:47:52
问题 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? 回答1: 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

Lucene.Net writing/reading synchronization

巧了我就是萌 提交于 2019-12-30 03:09:09
问题 Could I write (with IndexWriter ) new documents into index while it is opened for reading (with IndexReader )? Or must I close reading before writing? Could I read/search documents (with IndexReader ) in index while it is opened for writing (with IndexWriter )? Or must I close writing before reading? Is Lucene.Net thread safely or not? Or must I write my own? 回答1: You may have any amount of readers/searchers opened at any time, but only one writer. This is enforced by a directory specific

Using several database setups with Lucene.Net

牧云@^-^@ 提交于 2019-12-25 09:35:36
问题 Hi I am developing a search function for an web application with Lucene.Net and NHibernate.Search. The application is used by a lots of companies but is runned as a single service, using different databases for different companies. Therefore I would need an index directory for each database rather than one directory for the entire application. Is there a way of achieve this in Lucene.Net? I have also considering storing the indexes for each company in there respecitive database but havent

Using several database setups with Lucene.Net

大城市里の小女人 提交于 2019-12-25 09:30:04
问题 Hi I am developing a search function for an web application with Lucene.Net and NHibernate.Search. The application is used by a lots of companies but is runned as a single service, using different databases for different companies. Therefore I would need an index directory for each database rather than one directory for the entire application. Is there a way of achieve this in Lucene.Net? I have also considering storing the indexes for each company in there respecitive database but havent

System.OutOfMemoryException

笑着哭i 提交于 2019-12-25 04:49:25
问题 I have a program written in asp.net with lucene.net. At first I create an index from 28000 documents. Secondly I'm executing a search, but sometimes there is an error. (I think this error is thrown when there are many results) The important part of code: Dim hits As Hits = searcher.Search(query) Dim results As Integer = hits.Length() 'ergebnisse (größe der hits) '##################### '####### RESULTS ##### '##################### trefferanzahl = results If (results > 0) Then Dim i As Integer

Search in Single-Token-Field using Lucene.NET

。_饼干妹妹 提交于 2019-12-25 03:15:30
问题 I´m using Lucene.NET 3.0.3 for indexing the content of word-, excel-, etc. documents and some custom fields for each document. If I index a field named "title" as Field.Index.NOT_ANALYZED the Lucene-Index stored the field in correct form. The hole title is stored in a single token. That´s what I want. e.g. title of document is "Lorem ipsum dolor" field in Lucene-index: "Lorem ipsum dolor" If I search using exact search in this field I get no results. My searchterm looks like: title:"Lorem

Umbraco and Indexing

流过昼夜 提交于 2019-12-25 03:15:00
问题 I have a Visual Studio project with 2 solutions: Solution 1: UmbracoCms (Umbraco 7.2 code base) Solution 2: SeachIndexer (lucene.net spatial - Windows Console Application) In my solution 2 I have reference to the following .dlls from the Umbraco solution: UmbracoCms.dll cms.dll businesslogic.ddl umbraco.dll umbraco.DataLayer.dll In the Program.cs file I have the following code: Node rootNode = new Node(1103); string nodeTypeAlias = "articlePage"; if (node.NodeTypeAlias == nodeTypeAlias)

Lucene.NET - checking if document exists in index

不想你离开。 提交于 2019-12-25 02:28:31
问题 I have the following code, using Lucene.NET V4, to check if a file exists in my index. bool exists = false; IndexReader reader = IndexReader.Open(Lucene.Net.Store.FSDirectory.Open(lucenePath), false); Term term = new Term("filepath", "\\myFile.PDF"); TermDocs docs = reader.TermDocs(term); if (docs.Next()) { exists = true; } The file myFile.PDF definitely exists, but it always comes back as false . When I look at docs in debug, its Doc and Freq properties state that they "threw an exception of