I have an amazon cloudsearch domain. The aim is to filter if the field 'language' exists. Not all objects have a language, and I want to have the ones which do have a language filtered, but the ones that do not have any language to also be returned.
I want to filter with ( or language:'en' language:null )
However null cannot be passed within a string.
Is this possible? If so how would it be done.
Amazon search is deprecated: Amazon search service is no longer supported. To set up a search functionality on your site(s), configure one of the three built-in search services instead. Amazon Cloud Search is deprecated in Sitefinity 13.3.
Amazon CloudSearch lets customers add search capability without needing to manage hosts, traffic and data scaling, redundancy, or software packages. Users pay low hourly rates only for the resources consumed.
Amazon CloudSearch is a managed service in the AWS Cloud that makes it simple and cost-effective to set up, manage, and scale a search solution for your website or application. Amazon CloudSearch supports 34 languages and popular search features such as highlighting, autocomplete, and geospatial search.
If you are willing to use the Lucene query parser you can express your query like this:
(*:* OR -language:*) OR language:en
Note: The funky (*:* OR ...)
construct is necessary because of the way Lucene treats negated OR clauses.
In general, you can filter by existence / non-existence of a field with the Lucene query parser:
All documents containing field
: field:[* TO *]
All documents not containing field
: -field:[* TO *]
Note: If field
is textual (text or literal datatypes) you don't need range queries and you can shorten the above to:
field:*
and -field:*
I looked elsewhere aswell, it seems :
The simplest way to do that, is to set a default value for the field, and then use that value for your null.
For example, set the default to the string "null", then you can easily test for that.
I believe you can add a default value, and re-index, and that should reapply the default.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With