lucene.net

Calculate the score only based on the documents have more occurance of term in lucene

你。 提交于 2019-12-05 08:27:46
I am started working on resume retrieval(document) component based on lucene.net engine. It works great, and it fetches the document and score it based on the the idea behind the VSM is the more times a query term appears in a document relative to the number of times the term appears in all the documents in the collection, the more relevant that document is to the query. Lucene's Practical Scoring Function is derived from the below. score(q,d)=coord(q,d)·queryNorm(q)· ∑( tf(t in d) ·idf(t)2 · t.getBoost() · norm(t,d) ) t in q in this tf(t in d) correlates to the term's frequency, defined as

Why is Lucene.Net indexer throwing a System.IO.IOException was unhandled?

坚强是说给别人听的谎言 提交于 2019-12-05 07:56:59
The exception is thrown up at times saying the file write.lock cannot be used as it is being used by another process, however this is a very simple test app for Lucene.Net and there's no other process using it, any idea of how this may be The exception details are as follows: System.IO.IOException was unhandled HResult=-2147024864 Message=The process cannot access the file 'c:\temp\luceneidx\write.lock' because it is being used by another process. Source=mscorlib StackTrace: at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath) at System.IO.File.InternalDelete(String path,

How to customize Lucene.NET to search for words with symbols without case-sensitivity (e.g. “C#” or “.net”)?

落花浮王杯 提交于 2019-12-05 07:49:59
The standard analyzer does not work. From what I can understand, it changes this to a search for c and net The WhitespaceAnalyzer would work but it's case sensitive. The general rule is search should work like Google so hoping it's a configuration thing considering .net , c# have been out there for a while or there's a workaround for this. Per the suggestions below, I tried the custom WhitespaceAnalyzer but then if the keywords are separated by a comma and no-space are not handled correctly e.g. java,.net,c#,oracle will not be returned while searching which would be incorrect. I came across

Lucene.net 2.9.2 sorting (sort doesn't work)

北城以北 提交于 2019-12-05 07:47:51
I've got problem with sorting my lucene.net index in .NET. I tried almost every solution on stackoverflow and looking for google answers. I'm using Lucene.NET 2.9.2 and ASP.NET 2.0. I want to sort over string like in sql you can type 'order by Title desc [asc]' I will show you my code and I hope someone can help me. //Here I create Index with some fields doc.Add(new Field("prod_id",row["prod_id"].ToString(),Field.Store.YES,Field.Index.ANALYZED)); doc.Add(new Field("prod_title", row["prod_title"].ToString(), Field.Store.YES, Field.Index.ANALYZED)); doc.Add(new Field("prod_desc", row["prod_desc"

Upgrading sitecore 6.6 index configuration to sitecore 7 (using ComputedFields)

六月ゝ 毕业季﹏ 提交于 2019-12-05 06:48:27
Sitecore CMS+DMS 6.6.0 rev.130404 => 7.0 rev.130424 In our project we have been using AdvancedDatabaseCrawler (ADC) for our indexes (specially because of it's dynamic fields feature). Here's a sample index configuration: <index id="GeoIndex" type="Sitecore.Search.Index, Sitecore.Kernel"> <param desc="name">$(id)</param> <param desc="folder">$(id)</param> <analyzer ref="search/analyzer" /> <locations hint="list:AddCrawler"> <web type="scSearchContrib.Crawler.Crawlers.AdvancedDatabaseCrawler, scSearchContrib.Crawler"> <database>web</database> <root>/sitecore/content/Globals/Locations</root>

Sitecore Search Predicate Builder multiple keyword search with boosting not working as desired

荒凉一梦 提交于 2019-12-05 05:39:18
I have sitecore pages / lucene documents with the following fields: Title Filename Content File Contents I'm creating a search for these and have the following requirements: Hits containing the whole phrase in the title field should be returned first. Hits containing the whole phrase in the filename field should be returned second. Hits containing the whole phrase in the content should be returned third Hits containing the whole phrase in the file contents should be returned fourth Hits containing all of the keywords (in any order) in the title field should be returned fifth Hits containing

How to add documents in Lucene.Net.Linq?

半城伤御伤魂 提交于 2019-12-05 00:58:14
问题 The Lucene.Net.Linq project seems pretty powerful and while querying seems pretty simple, I'm not quite sure how to add/update documents. Can an example or two be provided? 回答1: There are some full examples in the test project at https://github.com/themotleyfool/Lucene.Net.Linq/tree/master/source/Lucene.Net.Linq.Tests/Samples. Once you've configured your mappings and initialized your provider, you make updates by opening a session: var directory = new RAMDirectory(); var provider = new

figuring out reason for maxClauseCount is set to 1024 error

蓝咒 提交于 2019-12-05 00:30:51
I've two sets of search indexes. TestIndex (used in our test environment) and ProdIndex(used in PRODUCTION environment). Lucene search query: +date:[20090410184806 TO 20091007184806] works fine for test index but gives this error message for Prod index. "maxClauseCount is set to 1024" If I execute following line just before executing search query, then I do not get this error. BooleanQuery.SetMaxClauseCount(Int16.MaxValue); searcher.Search(myQuery, collector); Am I missing something here? Why am not getting this error in test index?The schema for two indexes are same.They only differ wrt to

How to get more out of Lucene.net

陌路散爱 提交于 2019-12-04 23:13:32
问题 I'm trying to incorporate Lucene.net in my web search. Currently I have a lucene.net index that contains +1 million documents with 7 fields each. The last field is the "all" field that has the content of the previous fields concatenated. Searching the all field is just EXTREMELY fast :) But I feel there is more to be found here. How can I make a search that searches one or more space separated strings over all the fields without using the "all" field? I want to be able to give weights to

lucene.net combine multiple filters and no search terms

限于喜欢 提交于 2019-12-04 22:47:00
问题 How can I do a Filter across multiple fields in Lucene.Net? On one field I simply do: TermQuery tool = new TermQuery(new Term("Tool", "Nail")); Filter f = new QueryFilter(tool); If I now wanted to add a nail length to the filter, how can I do that? Also, I want the user to be a able to do a search with no search term (i.e. by just choosing a category) how can I do that? 回答1: I think you're asking two questions... Question 1: Adding an additional filter Remember, QueryFilter accepts any query