lucene

Hibernate Search and a complex relationship

北城余情 提交于 2020-01-01 19:58:10
问题 For design reasons, the relationship between my entities is as follows: Having entities A, B, C and AB where AB is the relationship many to many. I want to index the values of the entity C that has a many to many relationship with the B, starting from the relationship with A. So far I can index the values of A and B without problems in the following way: @Entity @Indexed public class A { @Field ... @IndexedEmbedded(depth = 2) @OneToMany(mappedBy = "a", cascade = CascadeType.ALL) private List

Finding a single fields terms with Lucene (PyLucene)

风流意气都作罢 提交于 2020-01-01 17:20:13
问题 I'm fairly new to Lucene's Term Vectors - and want to make sure my term gathering is as efficient as it possibly can be. I'm getting the unique terms and then retrieving the docFreq() of the term to perform faceting. I'm gathering all documents terms from the index using: lindex = SimpleFSDirectory(File(indexdir)) ireader = IndexReader.open(lindex, True) terms = ireader.terms() #Returns TermEnum This works fine, but is there a way to only return terms for specific fields (across all documents

nHibernate.Search with nHibernate v2

醉酒当歌 提交于 2020-01-01 14:39:31
问题 I having trouble getting nHibernate.Search to create an Index. If I use 1.2.1.4 of nHibernate.dll & nHibernate.Search.dll then the index is created correctly and I can inspect it with Luke (a Lucene utility). A segments file is created as well as a Fragments file etc However, when I use v 2 of nHibernate.dll & nHibernate.Search.dll then the index is not created correctly. Only a 1k segments file is created in the Index directory and Luke is unable to inspect it. The code I used in v1 was as

what is the best lucene setup for ranking exact matches as the highest

浪子不回头ぞ 提交于 2020-01-01 10:06:07
问题 Which analyzers should be used for indexing and for searching when I want an exact match to rank higher then a "partial" match? Possibly set up custom scoring in a Similarity class? For example, when my index consist of car parts , car , and car shop (indexed with StandardAnalyzer on lucene 3.5), a query for "car" results in: car parts car car shop (basically returned in the order in which they were added, since they all get the same score). What I would like to see is car ranked first, then

what is the best lucene setup for ranking exact matches as the highest

荒凉一梦 提交于 2020-01-01 10:05:07
问题 Which analyzers should be used for indexing and for searching when I want an exact match to rank higher then a "partial" match? Possibly set up custom scoring in a Similarity class? For example, when my index consist of car parts , car , and car shop (indexed with StandardAnalyzer on lucene 3.5), a query for "car" results in: car parts car car shop (basically returned in the order in which they were added, since they all get the same score). What I would like to see is car ranked first, then

How to do grouping in Lucene search results?

浪子不回头ぞ 提交于 2020-01-01 10:02:16
问题 How do I group search results returned by Lucene by fields (similar to SQL Server's)? 回答1: Lucene 3.4 now supports faceted search. At indexing you specify something supplementary and at search time you search by query and by groups. for next 3 docs, that you index with these groups doc1: monday, 1pm, 3min doc2: monday, 1pm, 4min doc3: monday, 2pm, 3min you can search only for the first param: monday, and get value:3, or you can drill down and search for monday/1pm and get value:2 or set depth

elastic search double facet

主宰稳场 提交于 2020-01-01 09:59:27
问题 I want to run an elastic search query which groups data by the combination of two different fields (Latitude and Longitude) curl -XGET http://www.my_server:9200/idx_occurrence/Occurrence/_search?pretty=true -d '{ "query": { "query_string" : { "fields" : ["genus_interpreted","dataset"], "query": "Pica 2", "default_operator" : "AND" } }, "facets": { "test": { "terms": { "fields" :["decimalLatitude","decimalLongitude"], "size" : 500000000 } } } }' It gives a double number of results than

Elasticsearch wildcard search on not_analyzed field

余生长醉 提交于 2020-01-01 09:24:15
问题 I have an index like following settings and mapping; { "settings":{ "index":{ "analysis":{ "analyzer":{ "analyzer_keyword":{ "tokenizer":"keyword", "filter":"lowercase" } } } } }, "mappings":{ "product":{ "properties":{ "name":{ "analyzer":"analyzer_keyword", "type":"string", "index": "not_analyzed" } } } } } I am struggling with making an implementation for wildcard search on name field. My example data like this; [ {"name": "SVF-123"}, {"name": "SVF-234"} ] When I perform following query;

Solr 4.4: StopFilterFactory and enablePositionIncrements

半世苍凉 提交于 2020-01-01 09:23:58
问题 While attempting to upgrade from Solr 4.3.0 to Solr 4.4.0 I ran into this exception: java.lang.IllegalArgumentException: enablePositionIncrements=false is not supported anymore as of Lucene 4.4 as it can create broken token streams which led me to this issue. I need to be able to match queries irrespective of intervening stopwords (which used to work with enablePositionIncrements="true"). For instance: "foo of the bar" would find documents matching "foo bar", "foo of bar", and "foo of the bar

Solr 4.4: StopFilterFactory and enablePositionIncrements

百般思念 提交于 2020-01-01 09:23:09
问题 While attempting to upgrade from Solr 4.3.0 to Solr 4.4.0 I ran into this exception: java.lang.IllegalArgumentException: enablePositionIncrements=false is not supported anymore as of Lucene 4.4 as it can create broken token streams which led me to this issue. I need to be able to match queries irrespective of intervening stopwords (which used to work with enablePositionIncrements="true"). For instance: "foo of the bar" would find documents matching "foo bar", "foo of bar", and "foo of the bar