lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Furkan KAMACI <furkankam...@gmail.com>
Subject Re: Filter if Field Exists
Date Mon, 17 Apr 2017 11:18:10 GMT
Btw, what is the difference between

+name:test +(type:research (*:* -type:[* TO *]))

and

+name:test +(type:research -type:[* TO *])

On Mon, Apr 17, 2017 at 1:33 PM, Furkan KAMACI <furkankamaci@gmail.com>
wrote:

> Actually, amount of documents which have 'type' field is relatively too
> small across all documents at index.
>
> On Mon, Apr 17, 2017 at 7:08 AM, Alexandre Rafalovitch <arafalov@gmail.com
> > wrote:
>
>> What about setting a default value for the field? That is probably
>> faster than negative search clauses?
>>
>> Regards,
>>    Alex.
>> ----
>> http://www.solr-start.com/ - Resources for Solr users, new and
>> experienced
>>
>>
>> On 16 April 2017 at 23:58, Mikhail Khludnev <mkhl@apache.org> wrote:
>> > +name:test +(type:research (*:* -type:[* TO *]))
>> >
>> > On Sun, Apr 16, 2017 at 11:47 PM, Furkan KAMACI <furkankamaci@gmail.com
>> >
>> > wrote:
>> >
>> >> Hi,
>> >>
>> >> I have a schema like:
>> >>
>> >> name,
>> >> department,
>> >> type
>> >>
>> >> type is an optional field. Some documents don't have that field. Let's
>> >> assume I have these:
>> >>
>> >> Doc 1:
>> >> name: test
>> >> type: research
>> >>
>> >> Doc 2:
>> >> name: test
>> >> type: developer
>> >>
>> >> Doc 3:
>> >> name: test
>> >>
>> >> I want to search name: test and type:research if type field exists
>> (result
>> >> will be Doc 1 and Doc 3).
>> >>
>> >> How can I do that?
>> >>
>> >> Kind Regards,
>> >> Furkan KAMACI
>> >>
>> >
>> >
>> >
>> > --
>> > Sincerely yours
>> > Mikhail Khludnev
>>
>
>

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message