solr

Has lucene search engine (Not Solr) REST API for querying the indexed content?

為{幸葍}努か 提交于 2019-12-11 17:18:58
问题 How to query the indexed content in Lucene. Do we need to write any script or any api's available to query the index. 回答1: How to query the indexed content in Lucene? You write a Java class using ÌndexReader and ÌndexSearcher classes of Lucene API. You need to build a query and pass on to searcher instance as parameter. There is no automatic REST point. Lucene is simply an API, originally in Java then later ported to.NET too so either you can use Java or C# to develop your index creator as

SoLR - How to filter out records which do not have the field value for field listed in SORT?

我的未来我决定 提交于 2019-12-11 17:15:01
问题 In SoLR, We can set sortMissingLast=true on a field in the schema. If the SORT is on this field, it will to push the results which have missing field values to the end. Is there a way to filter out the results whose sort field values are missing? Please advise. 回答1: If you want to restrict your query to documents that only have a certain field set, add the following parameter to your query: sort_field_name:[* TO *] This will limit the query to only those documents where the sort field exists.

SOLR ignoring comma and other punctuation while searching

荒凉一梦 提交于 2019-12-11 16:58:13
问题 I want to search 100,000 and 100000 only by querying 100000 (or only by querying 100,000). Is it possible to search like that. The purpose to perform this is, that user may add a comma at any place or no comma at all but the strings (100,000 or 100000) should be searched anyway... 回答1: Don't know if this is correct, but maybe you can write some kind of filter factory where numbers are always indexed as numbers formatted with commas and with out commas. Or you can have both the index & query

php of jquery to access solr?

£可爱£侵袭症+ 提交于 2019-12-11 16:43:34
问题 im a beginner in using solr. i know that you can either use ajax solr or solr-php-client to get the search results from solr. but which should i use or are there occasions you have to choose one of them? for example, which one is a better solution for autocompletion and which one is better for search content in threads? would appreciate if someone could shed a light on this. 回答1: Use PHP (or another server side language) for essential functionality. Use client side JS for optional extras.

Solr - Differentiating between exact match and Partial Match OR grouping based on scores

时光总嘲笑我的痴心妄想 提交于 2019-12-11 16:37:01
问题 In my current Solr search implementation, I get results based on scores - which is fine. However, I want to create two groups from the results. The first group should be a relevant group (when all the query words are present in the document) and the second group should be the related group (when only partial words from query exist in the document). "response":{"numFound":206,"start":0,"maxScore":11.856699,"docs":[ { "Product":["KW Cyber Security Digital Product"], "score":11.856699}, {

SolrJ - Indexing multiple classes and ensuring document uniqueness

旧时模样 提交于 2019-12-11 16:28:06
问题 I want to use SolrJ for indexing a set of Java classes. Each class instance is determined by its id which is unique within a class. However, by using the Solr @Field annotation for making Solr documents from these classes it turns out that this annotation doesn't guarantee uniqueness of the created documents stored in the Solr index (same id values may belong to multiple classes). I tried combining the annotation approach with the Solr UUID data type for generating unique id values into a

Elasticsearch - query primary and secondary attribute with different terms

荒凉一梦 提交于 2019-12-11 16:23:59
问题 I'm using elasticsearch to query data that originally was exported out of several relational databases that had a lot of redundencies. I now want to perform queries where I have a primary attribute and one or more secondary attributes that should match. I tried using a bool query with a must term and a should term, but that doesn't seem to work for my case, which may look like this: Example: I have a document with fullname and street name of a user and I want to search for similiar users in

solr LowerCaseFilterFactory not working

会有一股神秘感。 提交于 2019-12-11 15:57:20
问题 For case-insensitive sort in solr, I have added the following in the config: <fieldType class="org.apache.solr.schema.TextField" name="TextField" sortMissingLast="true" omitNorms="true"> <analyzer> <tokenizer class="solr.KeywordTokenizerFactory"/> <filter class="solr.LowerCaseFilterFactory"/> </analyzer> </fieldType> and the field as follows: <field indexed="true" multiValued="false" name="nm" stored="true" type="TextField" docValues ="true"/> I have tried: solr case insensitive sort not

finding duplicate field values in solr

梦想的初衷 提交于 2019-12-11 15:57:01
问题 Using Solr 4.3 I have a field "digest" in a solr index - and I would like to execute a query that will return me all the cases where there are duplicate values of digest. Can this be done? For the records that have duplicate values, I would like to return other values - such as "url" which may not be duplicated. 回答1: You have two options, neither perfect. You can use Grouping/Field Collapsing which will group by digest and can give you other fields, but does not allow you to avoid groups with

Manipulating query using Custom Query Parser in Solr

心已入冬 提交于 2019-12-11 15:48:59
问题 I have tried to create a CustomQueryParser where I am making use of OpenNLP libraries as well. My objective is if i have a query "How many defective rims are causing failure in ABC tyres in China" I want the final query to be something like "defective rims failure tyres China" which then would go to the Analyzer for further processing. This is my code for QueryParserPlugin - package com.mycompany.lucene.search; import org.apache.solr.common.params.SolrParams; import org.apache.solr.request