lucene.net

SitecoreSearchContrib - How to merge & sort from multiple indexes

情到浓时终转凉″ 提交于 2019-12-24 21:33:14
问题 I'm currently setting up a search for a Sitecore 6.6 web site using SitecoreSearchContrib. I've got two indexes. One index looking at my web site content: /sitecore/content/home and another index looking in a documents folder in the media library (which contains PDF etc). /sitecore/media library/documents The search on my web site can return web pages or Word/PDF documents. Is there a way (beside using one super-index for content & media library) that I can combine the results from both

How do I use lucene.net for searching file content?

假装没事ソ 提交于 2019-12-24 08:46:32
问题 I am currently using lucene.net to search the content of files for keyword search. I am able to get the results correctly but I have a scenario where I need to display the keywords found in a particular file. There are two different files containing " karthik " and " steven ", and if I search for " karthik and steven " I am able to get both the files displayed. If I search only for " karthik " and " steven " separately, only the respective files are getting displayed. When I search for "

What's the point of Lucene NumericUtils.IntToPrefixCoded

帅比萌擦擦* 提交于 2019-12-24 07:59:25
问题 I've been looking at Subtext's Lucene.Net implementation as a guide to do something similar with our websites. When Subtext index or search for a given post, it runs the ID through NumericUtils.IntToPrefixCoded. According to the Lucene docs, it does some shifting, but doesn't lose precision. So, what's the point? What does it do, and why? 回答1: You need to look at the class documentation, which explains it in more detail: To quickly execute range queries in Apache Lucene, a range is divided

Do I need to call .Dispose() on the StandardAnalyzer, or does .Dispose() on the IndexWriter dispose its descendants?

耗尽温柔 提交于 2019-12-24 05:49:52
问题 Initializing an IndexWriter in Lucene.Net looks like this: var analyzer = new Lucene.Net.Analysis.Standard.StandardAnalyzer(version); var indexWriterConfig = new Lucene.Net.Index.IndexWriterConfig(version, analyzer); Index = new Lucene.Net.Index.IndexWriter(luceneDir, indexWriterConfig); That is, you can't instantiate an IndexWriter without an Analyzer. So, I would expect that calling .Dispose() on the IndexWriter would dispose its children, including the Analyzer. However browsing the code I

Sitecore + Lucene + QueryOccurance.Should not returning desired results

北慕城南 提交于 2019-12-24 03:31:30
问题 I Am using Alex Shybas Advanced DatabaseCrawler and it is working beautifully... almost... I Am using for a carsales application in which you can search for a car using the following values Model Make Fuel Mileage Price Year (Registration date) I have multiple NumericRange queryies: -1000 - 0 (this is for those dealers, that do not want the price online. They write the price as -1) bottom to top ie. (10000 - 20000) This is what i want to sort by The are both in the same

How do I pass a list of 'allowed' IDs to filter a Lucene search?

我只是一个虾纸丫 提交于 2019-12-24 01:54:09
问题 I need to return just the documents that a user has access to from a Lucene search. I can get a list of IDs from a database that make up the 'allowed' subset. How can I pass these to Lucene? The articles I've found on the web suggest I need to use a BitSet and FieldCache (am I right?), but I'm having trouble finding good examples. Does anyone have any? I'm using C#, but any language would be great. Thanks. 回答1: A simple way would be to build a MultiPhraseQuery with an array of all the

How to do a Lucene search with Sitecore item with specific date?

纵然是瞬间 提交于 2019-12-24 01:45:10
问题 I've a Content item is Sitecore with the date field named 'EventDate'. I want to search those items with specific date using Lucene.Net. Below is the code I've tried but i am not getting the result: var index = SearchManager.GetIndex("event_search_index"); var items = new List<EventDetailItem>(); var eventDateString = eventDate.Year.ToString("D4") + eventDate.Month.ToString("D2") + eventDate.Date.Day.ToString("D2"); using (var context = new IndexSearchContext(index)) { var searchTerm = new

How do I rebuild a custom Lucene index on a Sitecore content delivery server?

跟風遠走 提交于 2019-12-23 09:32:34
问题 The custom Lucene index on my Sitecore 6.2 Content Delivery server seems to be not right. So I think I need to rebuild all 3 of my custom indexes. How do I do that? Do I just have to use the shared source Index Viewer module? Right now I have that installed on my CD server, however for some reason it is not working. When I select my custom index in Index Viewer - nothing happens. So I can't rebuild the index that way. Can I just delete the index files from the hard drive? If so, how quickly

Lucene.Net - IndexWriter.SetMergedSegmentWarmer [closed]

你离开我真会死。 提交于 2019-12-23 07:00:31
问题 It's difficult to tell what is being asked here. This question is ambiguous, vague, incomplete, overly broad, or rhetorical and cannot be reasonably answered in its current form. For help clarifying this question so that it can be reopened, visit the help center. Closed 7 years ago . Anyone have an example of how to use IndexWriter.SetMergedSegmentWarmer in Lucene.Net? When I try something like... IndexWriter.IndexReaderWarmer warmer = new IndexWriter.IndexReaderWarmer(); indexWriter

Random Sorting Results in Lucene.Net 2.4

心不动则不痛 提交于 2019-12-23 06:08:32
问题 How do I sort my results in a random order. my code looks something like this at the moment: Dim searcher As IndexSearcher = New IndexSearcher(dir, True) Dim collector As TopScoreDocCollector = TopScoreDocCollector.create(100, True) searcher.Search(query, collector) Dim hits() As ScoreDoc = collector.TopDocs.scoreDocs For Each sDoc As ScoreDoc In hits 'get doc and return Next 回答1: Since this is an IEnumerable, you can use standard linq to randomize it. You can find an example here: public