lucene.net

How can I check if a Lucene IndexWriter instance is valid/open?

旧巷老猫 提交于 2019-12-10 13:55:58
问题 Sorry for the simple question, but there doesn't seem to be any obvious way. According to the documentation, it is recommended to keep a single instance of IndexWriter in memory that can be used again and again for updates, as opposed to opening and closing one for each change (which is much more costly). However, the documentation also states that the IndexWriter should be closed if an exception occurs (e.g. OutOfMemoryException ). Therefore, I need some way to check if my instance of

What's the most efficient way to retrieve all matching documents from a query in Lucene, unsorted?

柔情痞子 提交于 2019-12-10 13:24:26
问题 I am looking to perform a query for the purposes of maintaining internal integrity; for example, removing all traces of a particular field/value from the index. Therefore it's important that I find all matching documents (not just the top n docs), but the order they are returned in is irrelevant. According to the docs, it looks like I need to use the Searcher.Search( Query, Collector ) method, but there's no built in Collector class that does what I need. Should I derive my own Collector for

Lucene Hightlighter sometimes inexplicably returns blank fragments

爷,独闯天下 提交于 2019-12-10 13:22:18
问题 I've been working on a Lucene document search program for the last few days and everything has been overall going well, until now. I'm trying to use the Lucene.Net.Highlight.Highlighter class to show relevant snippets for my search results, but it isn't working consistently. Most of the time the calling Highlighter.GetBestFragments() does exactly what I'd expect (shows relevant text snippets with the given query string in them), but sometimes it just returns an empty string. I've triple

Matching entire sentence with spaces in lucene BooleanQuery

半世苍凉 提交于 2019-12-10 13:19:24
问题 I have a search string , Tulip INN Riyadhh Tulip INN Riyadhh LUXURY Suites of Tulip INN RIYAHdhh I need search term , if i mention *Tulip INN Riyadhh* it has to return all the three above, i have restriction that i have to achieve this without QueryParser or Analyser, it has to be only BooleanQuery/WildCardQuery/etc.... Regards, Raghavan 回答1: What you need here is a PhraseQuery . Let me explain. I don't know which analyzer you're using, but I'll suppose you have a very basic one for

Lucene.NET on shared hosting

风格不统一 提交于 2019-12-10 11:56:37
问题 I'm trying to get Lucene.NET to work on a shared hosting environment. Mascix over on codeproject outlines here how he got this to work on godaddy. I'm attempting this on isqsolutions. Both examples he posted run fine on my local machine and both throw the same error on the the shared hosting server: Compiler Error Message: CS0246: The type or namespace name 'Lucene' could not be found (are you missing a using directive or an assembly reference?) Line 1: <%@ Page Language="C#" %>Line 2: Line 3

Resources for getting started with Lucene.Net?

你。 提交于 2019-12-10 00:25:42
问题 I'm building a simple site that allows users to post text content and I want to add it to a search index as it gets posted, so my site search is up to date. From what I can tell Lucene.NET is a good full text search framework. I've found very few examples of how to use it though. Can anyone post some good references for learning about Lucene? 回答1: Some links: Lucene tutorial Another tutorial Lucene FAQ Lucene in action The new edition should be out soon The key point is that any Java material

In lucene.net can we search for a content without giving field name..and it will search in all fields that are indexed?

自闭症网瘾萝莉.ら 提交于 2019-12-09 14:35:01
问题 In lucene.net can we search for a content without giving field name..and it will search in all fields that are indexed. 回答1: You cannot search for content without giving field name, however you can use MultiFieldQueryParser to search in all available fields. E.g Dim queryParser = New MultiFieldQueryParser(Version.LUCENE_29, _ indexReader__1.GetFieldNames(IndexReader.FieldOption.ALL).ToArray(), analyzer) here is complete an example. 'get index directory Dim directory As Directory = FSDirectory

Looking for an example of using Lucene.net with ASP.NET [closed]

和自甴很熟 提交于 2019-12-09 04:00:47
问题 As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 6 years ago . How do you implement the search capabilities of Lucene.net in asp.net? If possible, please include links or example code. 回答1: I think

Lucene.Net fuzzy search speed

余生颓废 提交于 2019-12-09 03:50:55
问题 Sorry for the concern, but I hope to get any help from Lucene-experienced people. Now we use in our application Lucene.Net 3.0.3 to index and search by ~2.500.000 items. Each entity contains 27 searchable field, which added to index in this way: new Field(key, value, Field.Store.YES, Field.Index.ANALYZED)) Now we have two search options: Search only by 4 fields using fuzzy search Search by 4-27 fields using exact search We have a search service that every week automatically searches by about

How to search across all the fields?

a 夏天 提交于 2019-12-09 02:23:13
问题 In Lucene, we can use TermQuery to search a text with a field. I am wondering how to search a keyword across a bunch of fields or all the searchable fields? 回答1: Another approach, which doesn't require to index anything more than what you already have, nor to combine different queries, is using the MultiFieldQueryParser. You can provide a list of fields where you want to search on and your query, that's all. MultiFieldQueryParser queryParser = new MultiFieldQueryParser( Version.LUCENE_41, new