Phrase queries and slop and positionIncrementGap ;)

The fieldType has a positionIncrementGap. This is the token delta
between the end token of one entry and the beginning of the next.

so the first entry: IFREMER, Ctr Brest, DRO Geosci Marines, F-29280
Plouzane, France
IFREMER would have a position of 1 and France would have a position of 9 or so.
If the positionIncrementGap was 100 then this entry:
Univ Lisbon, Ctr Geofis, P-1269102 Lisbon, Portugal.
Univ would have a position of 110.

Now if I seach "IFREMER France"~99 it'd match the first one
but searching "IFREMER Lisbon"~99 it would not match since the
positions are > 99 apart.

So you configure the positionIncrementGap to be greater than the
longest number of tokens you ever expect to have in a single entry.

HTH
Erick

On Thu, Dec 15, 2016 at 3:44 AM, Dorian Hoxha <dorian.ho...@gmail.com> wrote:
> You should be able to filter "(word1 in field OR word2 in field) AND
> NOT(word1 in field AND word2 in field)". Translate that into the right
> syntax.
> I don't know if lucene is smart enough to execute the filter only once (it
> should be i guess).
> Makes sense ?
>
> On Thu, Dec 15, 2016 at 12:12 PM, Leo BRUVRY-LAGADEC <Leo.Bruvry.Lagadec@
> partenaire-exterieur.ifremer.fr> wrote:
>
>> Hi,
>>
>> I have a multivalued field in my schema called "idx_affilliation".
>>
>> <field name="idx_affilliation">IFREMER, Ctr Brest, DRO Geosci Marines,
>> F-29280 Plouzane, France.</field>
>> <field name="idx_affilliation">Univ Lisbon, Ctr Geofis, P-1269102 Lisbon,
>> Portugal.</field>
>> <field name="idx_affilliation">Univ Bretagne Occidentale, Inst Univ
>> Europeen Mer, Lab Domaines Ocean, F-29280 Plouzane, France.</field>
>> <field name="idx_affilliation">Total Explorat Prod Geosci Projets Nouveaux
>> Exper, F-92078 Paris, France.</field>
>>
>> I want to be able to do a query like: idx_affilliation:(IFREMER Portugal)
>> and not have this document returned. In other words, I do not want queries
>> to span individual values for the field.
>>
>> ------------------------------------------------------------
>> -----------------------------------
>>
>> Here are some further examples using the document above of how I want this
>> to work:
>>
>> idx_affilliation:(IFREMER France) --> Returns it.
>> idx_affilliation:(IFREMER Plouzane) --> Returns it.
>> idx_affilliation:("Univ Bretagne Occidentale") --> Returns it.
>> idx_affilliation:("Univ Lisbon" Portugal) --> Returns it.
>> idx_affilliation:(IFREMER Portugal) --> DOES NOT RETURN IT.
>>
>> Does someone known if it's possible to do this ?
>>
>> Best regards,
>> Leo.
>>

Reply via email to