Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

solr search for documents where a field doesn't exist

How do I search for those document in a SOLR index which do not contain a specified field?

like image 231
Midhat Avatar asked Dec 06 '10 10:12

Midhat


People also ask

How do I search for a specific field in Solr?

If you do not specify a field in a query, Solr searches only the default field. Alternatively, you can specify a different field or a combination of fields in a query. To specify a field, type the field name followed by a colon ":" and then the term you are searching for within the field.

How do you use exact match in Solr?

Phrase match: A simple way by which we can achieve exact matching in Solr is by using the default string type. It is exact phrase matching. the string is a useful type for facet where we search the index by using the text pulled from the index itself.

What does FQ mean in Solr?

The fq (Filter Query) Parameter The fq parameter defines a query that can be used to restrict the superset of documents that can be returned, without influencing score. It can be very useful for speeding up complex queries, since the queries specified with fq are cached independently of the main query.

What is Q in Solr query?

Solr provides Query (q parameter) and Filter Query (fq parameter) for searching. The query (q parameter), as the name suggests, is the main query used for searching. Example. q = title:james. Filter queries are used alongside query (q parameter) to limit results of queries using additional filters.


1 Answers

-field:[* TO *]

In SolrNet, use a negated SolrHasValueQuery

like image 143
Mauricio Scheffer Avatar answered Oct 14 '22 18:10

Mauricio Scheffer