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 Kamal Kishore Aggarwal <kk...@gmail.com> on 2016/09/02 11:03:32 UTC

Blank/Null value search in term filter

Hi,

We are using solr 5.4.1.

We are using term filter for multiple value matching purpose.
Example: fq={!terms f='queryField' separator='|'}A|B

A, B, C are the possible field values for solr field "queryField". There
can docs with null values for the same field. Now, how can I create a term
filter in above fashion that fetches docs with A or null values.

Please suggest.

Regards
Kamal

Re: Blank/Null value search in term filter

Posted by Alexandre Rafalovitch <ar...@gmail.com>.
If you only have 3 values, can you do negative queries on the ones you want
to skip?

Regards,
    Alex

On 5 Sep 2016 6:33 PM, "Kamal Kishore Aggarwal" <kk...@gmail.com>
wrote:

> Thanks Ahmet for your response and nice suggestion.
>
> But, I was looking if there any way out without making any configuration
> change.
>
> Please suggest.
>
> On 02-Sep-2016 9:37 PM, "Ahmet Arslan" <io...@yahoo.com> wrote:
>
> >
> >
> > Hi Kishore,
> >
> > You can employ an impossible token value (say XX) for null values.
> > This can be done via default value update processor factory.
> > You index some placeholder token for null values.
> > fq={!terms f='queryField' separator='|'}A|XX would fetche docs with A or
> > null values.
> > Ahmet
> >
> > On Friday, September 2, 2016 2:03 PM, Kamal Kishore Aggarwal <
> > kkroyal.192@gmail.com> wrote:
> >
> >
> >
> > Hi,
> >
> > We are using solr 5.4.1.
> >
> > We are using term filter for multiple value matching purpose.
> > Example: fq={!terms f='queryField' separator='|'}A|B
> >
> > A, B, C are the possible field values for solr field "queryField". There
> > can docs with null values for the same field. Now, how can I create a
> term
> > filter in above fashion that fetches docs with A or null values.
> >
> > Please suggest.
> >
> > Regards
> > Kamal
> >
>

Re: Blank/Null value search in term filter

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.

Hi Kishore,

Usually, query clause below is used for the task: 
(+*:* -queryField:[* TO *]) OR queryField:A

Ahmet




On Monday, September 5, 2016 2:33 PM, Kamal Kishore Aggarwal <kk...@gmail.com> wrote:
Thanks Ahmet for your response and nice suggestion.

But, I was looking if there any way out without making any configuration
change.

Please suggest.

On 02-Sep-2016 9:37 PM, "Ahmet Arslan" <io...@yahoo.com> wrote:

>
>
> Hi Kishore,
>
> You can employ an impossible token value (say XX) for null values.
> This can be done via default value update processor factory.
> You index some placeholder token for null values.
> fq={!terms f='queryField' separator='|'}A|XX would fetche docs with A or
> null values.
> Ahmet
>
> On Friday, September 2, 2016 2:03 PM, Kamal Kishore Aggarwal <
> kkroyal.192@gmail.com> wrote:
>
>
>
> Hi,
>
> We are using solr 5.4.1.
>
> We are using term filter for multiple value matching purpose.
> Example: fq={!terms f='queryField' separator='|'}A|B
>
> A, B, C are the possible field values for solr field "queryField". There
> can docs with null values for the same field. Now, how can I create a term
> filter in above fashion that fetches docs with A or null values.
>
> Please suggest.
>
> Regards
> Kamal
>

Re: Blank/Null value search in term filter

Posted by Kamal Kishore Aggarwal <kk...@gmail.com>.
Thanks Ahmet for your response and nice suggestion.

But, I was looking if there any way out without making any configuration
change.

Please suggest.

On 02-Sep-2016 9:37 PM, "Ahmet Arslan" <io...@yahoo.com> wrote:

>
>
> Hi Kishore,
>
> You can employ an impossible token value (say XX) for null values.
> This can be done via default value update processor factory.
> You index some placeholder token for null values.
> fq={!terms f='queryField' separator='|'}A|XX would fetche docs with A or
> null values.
> Ahmet
>
> On Friday, September 2, 2016 2:03 PM, Kamal Kishore Aggarwal <
> kkroyal.192@gmail.com> wrote:
>
>
>
> Hi,
>
> We are using solr 5.4.1.
>
> We are using term filter for multiple value matching purpose.
> Example: fq={!terms f='queryField' separator='|'}A|B
>
> A, B, C are the possible field values for solr field "queryField". There
> can docs with null values for the same field. Now, how can I create a term
> filter in above fashion that fetches docs with A or null values.
>
> Please suggest.
>
> Regards
> Kamal
>

Re: Blank/Null value search in term filter

Posted by Ahmet Arslan <io...@yahoo.com.INVALID>.

Hi Kishore,

You can employ an impossible token value (say XX) for null values.
This can be done via default value update processor factory.
You index some placeholder token for null values.
fq={!terms f='queryField' separator='|'}A|XX would fetche docs with A or null values.
Ahmet

On Friday, September 2, 2016 2:03 PM, Kamal Kishore Aggarwal <kk...@gmail.com> wrote:



Hi,

We are using solr 5.4.1.

We are using term filter for multiple value matching purpose.
Example: fq={!terms f='queryField' separator='|'}A|B

A, B, C are the possible field values for solr field "queryField". There
can docs with null values for the same field. Now, how can I create a term
filter in above fashion that fetches docs with A or null values.

Please suggest.

Regards
Kamal