You are viewing a plain text version of this content. The canonical link for it is here.
Posted to solr-user@lucene.apache.org by Gora Mohanty <go...@mimirtech.com> on 2013/03/13 13:37:08 UTC

Re: Search data who does not have "x" field

On 13 March 2013 17:57, anurag.jain <an...@gmail.com> wrote:
> Hi all,
>
> I am facing a problem.
[...]
> and some of data have "category" field and some of don't have.
>
> for example.
>
>
> {
> "id":"321",
> "name":"anurag",
> "category":"x"
> },
> {
> "id":"3",
> "name":"john"
> }
>
>
> now i want to search that data who does not have that field.
>
> what query should like.
[...]

Your subject line, and example are a bit confusing. I am guessing
that you want all records where the (not required) "category" field
does not exist. As http://wiki.apache.org/solr/SolrQuerySyntax notes,
-category:[* TO *] should do that.

Regards,
Gora