solr-query-syntax

Solr - How do I construct a query that requires a NOT NULL Location field

给你一囗甜甜゛ 提交于 2019-12-09 07:35:00
问题 I have a Solr index with a set of coordinates stored as a Location type; I would like to query for documents where this field has a non-null value. What is the query syntax to perform the NOT NULL check on a Location field? 回答1: The canonical way is this: fieldName:[* TO *] Using a '' on the left side as Paige Cook suggested will probably work too but I don't trust it as much as I do the above. And since this is to a Location field, you will probably have to do this against one of the two

How can I Ignore some fields in a SOLR query

给你一囗甜甜゛ 提交于 2019-12-06 08:07:43
I have Solr 5.3.1 and need to do query for all field except some field (what I need search in some field not retrieve fields this way to retrieve [/?q=query&fl=field1,field2,field3] ) i try with some solution but not work 1. How to exclude fields in a SOLR query [this soluation not work] 2.[the below solution work but take more time] query = field1:"+txtSearch+"OR field1:"+ txtSearch+" OR field1:"+txtSearch 3.I set indexed="false" in data-config.xml it only Ignore search in this field but when I search for all fields http://localhost:8983/solr/test?q=query the query search in all field

solr boost query with separate sort

天大地大妈咪最大 提交于 2019-12-04 06:38:15
问题 I want to demote all documents that have inv=0(possible values from 0 to 1000) to the end of the result set. i have got other sorting options like name desc also as part of the query. For example below are my solr documents Doc1 : name=apple , Inv=2 Doc2 : name=ball , Inv=1 Doc3 : name=cat , Inv=0 Doc4 : name=dog , Inv=0 Doc5 : name=fish , Inv=4 Doc6 : name=Goat , Inv=5 I want achieve below sorting ...here, i want to push all documents with inv=0 down to bottom and then apply "name asc"

How to exclude fields in a SOLR query

隐身守侯 提交于 2019-12-04 02:03:49
I have a SOLR query which should fetch all the fields I store, except one field. Say I have 20 fields, do I need to hard code the 19 fields I want to fetch in the &fl=[f],[f],[f],....[f]' Or is there a way to do something similar to &fl=*,![f]' [f] stands for a field name. Unfortunately the ability to remove a field name via the query string is still an outstanding improvement request. Please see SOLR-3191 for more details. Until this improvement is implemented, you will need to specify all 19 fields in the fl parameter. However, you could update your default /select requestHandler to define

What's wrong with this Solr range filter query?

 ̄綄美尐妖づ 提交于 2019-11-29 14:03:22
The following filter query returns zero results (using *:* as query): -startDate:[* TO *] OR startDate:[* TO NOW/DAY+1DAY] But if I filter only by: -startDate:[* TO *] I get 3 results. If I filter only by: startDate:[* TO NOW/DAY+1DAY] I get 161 reults. Why is the combined FQ returning zero results? What I want is the filter to return any doc whose start date is null or start date is before today. EDIT: I'm using Solr 4.2.1.2013.03.26.08.26.55 EDIT: Well, strange it may sound a colleague suggested putting parenthesis on the two parts like this: (-startDate:[* TO *]) OR (startDate:[* TO NOW/DAY

What's wrong with this Solr range filter query?

天大地大妈咪最大 提交于 2019-11-28 07:54:43
问题 The following filter query returns zero results (using *:* as query): -startDate:[* TO *] OR startDate:[* TO NOW/DAY+1DAY] But if I filter only by: -startDate:[* TO *] I get 3 results. If I filter only by: startDate:[* TO NOW/DAY+1DAY] I get 161 reults. Why is the combined FQ returning zero results? What I want is the filter to return any doc whose start date is null or start date is before today. EDIT: I'm using Solr 4.2.1.2013.03.26.08.26.55 EDIT: Well, strange it may sound a colleague