Re: Phrase Query only forward direction

2017-06-12 Thread Aman Deep Singh
Thanks Eric

On Mon, Jun 12, 2017 at 10:28 PM Erick Erickson 
wrote:

> Complex phrase also has an inorder flag that I think you're looking for
> here.
>
> Best,
> Erick
>
> On Mon, Jun 12, 2017 at 7:16 AM, Erik Hatcher 
> wrote:
> > Understood.   If you need ordered, “sloppy” (some distance) phrases, you
> could OR in a {!complexphrase} query.
> >
> >
> https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-ComplexPhraseQueryParser
> <
> https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-ComplexPhraseQueryParser
> >
> >
> > Something like:
> >
> > q=({!edismax … ps=0 v=$qq}) OR {!complexphrase df=nameSearch v=$qq}
> >
> > where =12345 masitha
> >
> > Erik
> >
> >
> >> On Jun 12, 2017, at 9:57 AM, Aman Deep Singh 
> wrote:
> >>
> >> Yes Erik I can use ps=0 but, my problem is that I want phrase which have
> >> same sequence and they can be present with in some distance
> >> E.g.
> >> If I have document masitha xyz 12345
> >> I want that to be boosted since the sequence is in order .That's why I
> have
> >> use ps=5
> >> Thanks,
> >> Aman Deep Singh
> >>
> >> On 12-Jun-2017 5:44 PM, "Erik Hatcher"  wrote:
> >>
> >> Using ps=5 causes the phrase matching to be unordered matching.   You’ll
> >> have to set ps=0, if using edismax, to get exact order phrase matches.
> >>
> >>Erik
> >>
> >>
> >>> On Jun 12, 2017, at 1:09 AM, Aman Deep Singh <
> amandeep.coo...@gmail.com>
> >> wrote:
> >>>
> >>> Hi,
> >>> I'm using a phrase query ,but it was applying the phrase boost to the
> >> query
> >>> where terms are in reverse order also ,which i don't want.Is their any
> way
> >>> to avoid the phrase boost for reverse order and apply boost only in
> case
> >> of
> >>> terms are in same sequence
> >>>
> >>> Solr version 6.5.1
> >>>
> >>> e.g.
> >>> http://localhost:8983/solr/l4_collection/select?debugQuery=o
> >> n=edismax=score,nameSearch=on=100%25&
> >> pf=nameSearch=12345%20masitha=nameSearch=xml=5
> >>>
> >>>
> >>> while my document has value
> >>>
> >>> in the debug query it is applying boost as
> >>> 23.28365 = sum of:
> >>> 15.112219 = sum of:
> >>> 9.669338 = weight(nameSearch:12345 in 0) [SchemaSimilarity], result of:
> >>> 9.669338 = score(doc=0,freq=1.0 = termFreq=1.0
> >>> ), product of:
> >>> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) /
> (docFreq
> >>> + 0.5)) from:
> >>> 2.0 = docFreq
> >>> 5197.0 = docCount
> >>> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 -
> b +
> >> b
> >>> * fieldLength / avgFieldLength)) from:
> >>> 1.0 = termFreq=1.0
> >>> 1.2 = parameter k1
> >>> 0.75 = parameter b
> >>> 5.2576485 = avgFieldLength
> >>> 2.56 = fieldLength
> >>> 5.44288 = weight(nameSearch:masitha in 0) [SchemaSimilarity], result
> of:
> >>> 5.44288 = score(doc=0,freq=1.0 = termFreq=1.0
> >>> ), product of:
> >>> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) /
> (docFreq
> >>> + 0.5)) from:
> >>> 70.0 = docFreq
> >>> 5197.0 = docCount
> >>> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 -
> b +
> >> b
> >>> * fieldLength / avgFieldLength)) from:
> >>> 1.0 = termFreq=1.0
> >>> 1.2 = parameter k1
> >>> 0.75 = parameter b
> >>> 5.2576485 = avgFieldLength
> >>> 2.56 = fieldLength
> >>> 8.171431 = weight(*nameSearch:"12345 masitha"~5 *in 0)
> [SchemaSimilarity],
> >>> result of:
> >>> 8.171431 = score(doc=0,freq=0.3334 = phraseFreq=0.3334
> >>> ), product of:
> >>> 11.940155 = idf(), sum of:
> >>> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) /
> (docFreq
> >>> + 0.5)) from:
> >>> 2.0 = docFreq
> >>> 5197.0 = docCount
> >>> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) /
> (docFreq
> >>> + 0.5)) from:
> >>> 70.0 = docFreq
> >>> 5197.0 = docCount
> >>> 0.6843655 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 -
> b +
> >> b
> >>> * fieldLength / avgFieldLength)) from:
> >>> 0.3334 = phraseFreq=0.3334
> >>> 1.2 = parameter k1
> >>> 0.75 = parameter b
> >>> 5.2576485 = avgFieldLength
> >>> 2.56 = fieldLength
> >>>
> >>> Thanks,
> >>> Aman Deep Singh
> >
>


Re: Phrase Query only forward direction

2017-06-12 Thread Erick Erickson
Complex phrase also has an inorder flag that I think you're looking for here.

Best,
Erick

On Mon, Jun 12, 2017 at 7:16 AM, Erik Hatcher  wrote:
> Understood.   If you need ordered, “sloppy” (some distance) phrases, you 
> could OR in a {!complexphrase} query.
>
> https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-ComplexPhraseQueryParser
>  
> 
>
> Something like:
>
> q=({!edismax … ps=0 v=$qq}) OR {!complexphrase df=nameSearch v=$qq}
>
> where =12345 masitha
>
> Erik
>
>
>> On Jun 12, 2017, at 9:57 AM, Aman Deep Singh  
>> wrote:
>>
>> Yes Erik I can use ps=0 but, my problem is that I want phrase which have
>> same sequence and they can be present with in some distance
>> E.g.
>> If I have document masitha xyz 12345
>> I want that to be boosted since the sequence is in order .That's why I have
>> use ps=5
>> Thanks,
>> Aman Deep Singh
>>
>> On 12-Jun-2017 5:44 PM, "Erik Hatcher"  wrote:
>>
>> Using ps=5 causes the phrase matching to be unordered matching.   You’ll
>> have to set ps=0, if using edismax, to get exact order phrase matches.
>>
>>Erik
>>
>>
>>> On Jun 12, 2017, at 1:09 AM, Aman Deep Singh 
>> wrote:
>>>
>>> Hi,
>>> I'm using a phrase query ,but it was applying the phrase boost to the
>> query
>>> where terms are in reverse order also ,which i don't want.Is their any way
>>> to avoid the phrase boost for reverse order and apply boost only in case
>> of
>>> terms are in same sequence
>>>
>>> Solr version 6.5.1
>>>
>>> e.g.
>>> http://localhost:8983/solr/l4_collection/select?debugQuery=o
>> n=edismax=score,nameSearch=on=100%25&
>> pf=nameSearch=12345%20masitha=nameSearch=xml=5
>>>
>>>
>>> while my document has value
>>>
>>> in the debug query it is applying boost as
>>> 23.28365 = sum of:
>>> 15.112219 = sum of:
>>> 9.669338 = weight(nameSearch:12345 in 0) [SchemaSimilarity], result of:
>>> 9.669338 = score(doc=0,freq=1.0 = termFreq=1.0
>>> ), product of:
>>> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>>> + 0.5)) from:
>>> 2.0 = docFreq
>>> 5197.0 = docCount
>>> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
>> b
>>> * fieldLength / avgFieldLength)) from:
>>> 1.0 = termFreq=1.0
>>> 1.2 = parameter k1
>>> 0.75 = parameter b
>>> 5.2576485 = avgFieldLength
>>> 2.56 = fieldLength
>>> 5.44288 = weight(nameSearch:masitha in 0) [SchemaSimilarity], result of:
>>> 5.44288 = score(doc=0,freq=1.0 = termFreq=1.0
>>> ), product of:
>>> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>>> + 0.5)) from:
>>> 70.0 = docFreq
>>> 5197.0 = docCount
>>> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
>> b
>>> * fieldLength / avgFieldLength)) from:
>>> 1.0 = termFreq=1.0
>>> 1.2 = parameter k1
>>> 0.75 = parameter b
>>> 5.2576485 = avgFieldLength
>>> 2.56 = fieldLength
>>> 8.171431 = weight(*nameSearch:"12345 masitha"~5 *in 0) [SchemaSimilarity],
>>> result of:
>>> 8.171431 = score(doc=0,freq=0.3334 = phraseFreq=0.3334
>>> ), product of:
>>> 11.940155 = idf(), sum of:
>>> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>>> + 0.5)) from:
>>> 2.0 = docFreq
>>> 5197.0 = docCount
>>> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>>> + 0.5)) from:
>>> 70.0 = docFreq
>>> 5197.0 = docCount
>>> 0.6843655 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
>> b
>>> * fieldLength / avgFieldLength)) from:
>>> 0.3334 = phraseFreq=0.3334
>>> 1.2 = parameter k1
>>> 0.75 = parameter b
>>> 5.2576485 = avgFieldLength
>>> 2.56 = fieldLength
>>>
>>> Thanks,
>>> Aman Deep Singh
>


Re: Phrase Query only forward direction

2017-06-12 Thread Erik Hatcher
Understood.   If you need ordered, “sloppy” (some distance) phrases, you could 
OR in a {!complexphrase} query.

https://cwiki.apache.org/confluence/display/solr/Other+Parsers#OtherParsers-ComplexPhraseQueryParser
 


Something like:

q=({!edismax … ps=0 v=$qq}) OR {!complexphrase df=nameSearch v=$qq}

where =12345 masitha

Erik


> On Jun 12, 2017, at 9:57 AM, Aman Deep Singh  
> wrote:
> 
> Yes Erik I can use ps=0 but, my problem is that I want phrase which have
> same sequence and they can be present with in some distance
> E.g.
> If I have document masitha xyz 12345
> I want that to be boosted since the sequence is in order .That's why I have
> use ps=5
> Thanks,
> Aman Deep Singh
> 
> On 12-Jun-2017 5:44 PM, "Erik Hatcher"  wrote:
> 
> Using ps=5 causes the phrase matching to be unordered matching.   You’ll
> have to set ps=0, if using edismax, to get exact order phrase matches.
> 
>Erik
> 
> 
>> On Jun 12, 2017, at 1:09 AM, Aman Deep Singh 
> wrote:
>> 
>> Hi,
>> I'm using a phrase query ,but it was applying the phrase boost to the
> query
>> where terms are in reverse order also ,which i don't want.Is their any way
>> to avoid the phrase boost for reverse order and apply boost only in case
> of
>> terms are in same sequence
>> 
>> Solr version 6.5.1
>> 
>> e.g.
>> http://localhost:8983/solr/l4_collection/select?debugQuery=o
> n=edismax=score,nameSearch=on=100%25&
> pf=nameSearch=12345%20masitha=nameSearch=xml=5
>> 
>> 
>> while my document has value
>> 
>> in the debug query it is applying boost as
>> 23.28365 = sum of:
>> 15.112219 = sum of:
>> 9.669338 = weight(nameSearch:12345 in 0) [SchemaSimilarity], result of:
>> 9.669338 = score(doc=0,freq=1.0 = termFreq=1.0
>> ), product of:
>> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>> + 0.5)) from:
>> 2.0 = docFreq
>> 5197.0 = docCount
>> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
> b
>> * fieldLength / avgFieldLength)) from:
>> 1.0 = termFreq=1.0
>> 1.2 = parameter k1
>> 0.75 = parameter b
>> 5.2576485 = avgFieldLength
>> 2.56 = fieldLength
>> 5.44288 = weight(nameSearch:masitha in 0) [SchemaSimilarity], result of:
>> 5.44288 = score(doc=0,freq=1.0 = termFreq=1.0
>> ), product of:
>> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>> + 0.5)) from:
>> 70.0 = docFreq
>> 5197.0 = docCount
>> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
> b
>> * fieldLength / avgFieldLength)) from:
>> 1.0 = termFreq=1.0
>> 1.2 = parameter k1
>> 0.75 = parameter b
>> 5.2576485 = avgFieldLength
>> 2.56 = fieldLength
>> 8.171431 = weight(*nameSearch:"12345 masitha"~5 *in 0) [SchemaSimilarity],
>> result of:
>> 8.171431 = score(doc=0,freq=0.3334 = phraseFreq=0.3334
>> ), product of:
>> 11.940155 = idf(), sum of:
>> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>> + 0.5)) from:
>> 2.0 = docFreq
>> 5197.0 = docCount
>> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
>> + 0.5)) from:
>> 70.0 = docFreq
>> 5197.0 = docCount
>> 0.6843655 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
> b
>> * fieldLength / avgFieldLength)) from:
>> 0.3334 = phraseFreq=0.3334
>> 1.2 = parameter k1
>> 0.75 = parameter b
>> 5.2576485 = avgFieldLength
>> 2.56 = fieldLength
>> 
>> Thanks,
>> Aman Deep Singh



Re: Phrase Query only forward direction

2017-06-12 Thread Aman Deep Singh
Yes Erik I can use ps=0 but, my problem is that I want phrase which have
same sequence and they can be present with in some distance
E.g.
If I have document masitha xyz 12345
I want that to be boosted since the sequence is in order .That's why I have
use ps=5
Thanks,
Aman Deep Singh

On 12-Jun-2017 5:44 PM, "Erik Hatcher"  wrote:

Using ps=5 causes the phrase matching to be unordered matching.   You’ll
have to set ps=0, if using edismax, to get exact order phrase matches.

Erik


> On Jun 12, 2017, at 1:09 AM, Aman Deep Singh 
wrote:
>
> Hi,
> I'm using a phrase query ,but it was applying the phrase boost to the
query
> where terms are in reverse order also ,which i don't want.Is their any way
> to avoid the phrase boost for reverse order and apply boost only in case
of
> terms are in same sequence
>
> Solr version 6.5.1
>
> e.g.
> http://localhost:8983/solr/l4_collection/select?debugQuery=o
n=edismax=score,nameSearch=on=100%25&
pf=nameSearch=12345%20masitha=nameSearch=xml=5
>
>
> while my document has value
>
> in the debug query it is applying boost as
> 23.28365 = sum of:
> 15.112219 = sum of:
> 9.669338 = weight(nameSearch:12345 in 0) [SchemaSimilarity], result of:
> 9.669338 = score(doc=0,freq=1.0 = termFreq=1.0
> ), product of:
> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 2.0 = docFreq
> 5197.0 = docCount
> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
b
> * fieldLength / avgFieldLength)) from:
> 1.0 = termFreq=1.0
> 1.2 = parameter k1
> 0.75 = parameter b
> 5.2576485 = avgFieldLength
> 2.56 = fieldLength
> 5.44288 = weight(nameSearch:masitha in 0) [SchemaSimilarity], result of:
> 5.44288 = score(doc=0,freq=1.0 = termFreq=1.0
> ), product of:
> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 70.0 = docFreq
> 5197.0 = docCount
> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
b
> * fieldLength / avgFieldLength)) from:
> 1.0 = termFreq=1.0
> 1.2 = parameter k1
> 0.75 = parameter b
> 5.2576485 = avgFieldLength
> 2.56 = fieldLength
> 8.171431 = weight(*nameSearch:"12345 masitha"~5 *in 0) [SchemaSimilarity],
> result of:
> 8.171431 = score(doc=0,freq=0.3334 = phraseFreq=0.3334
> ), product of:
> 11.940155 = idf(), sum of:
> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 2.0 = docFreq
> 5197.0 = docCount
> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 70.0 = docFreq
> 5197.0 = docCount
> 0.6843655 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b +
b
> * fieldLength / avgFieldLength)) from:
> 0.3334 = phraseFreq=0.3334
> 1.2 = parameter k1
> 0.75 = parameter b
> 5.2576485 = avgFieldLength
> 2.56 = fieldLength
>
> Thanks,
> Aman Deep Singh


Re: Phrase Query only forward direction

2017-06-12 Thread Erik Hatcher
Using ps=5 causes the phrase matching to be unordered matching.   You’ll have 
to set ps=0, if using edismax, to get exact order phrase matches.

Erik


> On Jun 12, 2017, at 1:09 AM, Aman Deep Singh  
> wrote:
> 
> Hi,
> I'm using a phrase query ,but it was applying the phrase boost to the query
> where terms are in reverse order also ,which i don't want.Is their any way
> to avoid the phrase boost for reverse order and apply boost only in case of
> terms are in same sequence
> 
> Solr version 6.5.1
> 
> e.g.
> http://localhost:8983/solr/l4_collection/select?debugQuery=on=edismax=score,nameSearch=on=100%25=nameSearch=12345%20masitha=nameSearch=xml=5
> 
> 
> while my document has value masitha 12345
> 
> in the debug query it is applying boost as
> 23.28365 = sum of:
> 15.112219 = sum of:
> 9.669338 = weight(nameSearch:12345 in 0) [SchemaSimilarity], result of:
> 9.669338 = score(doc=0,freq=1.0 = termFreq=1.0
> ), product of:
> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 2.0 = docFreq
> 5197.0 = docCount
> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b
> * fieldLength / avgFieldLength)) from:
> 1.0 = termFreq=1.0
> 1.2 = parameter k1
> 0.75 = parameter b
> 5.2576485 = avgFieldLength
> 2.56 = fieldLength
> 5.44288 = weight(nameSearch:masitha in 0) [SchemaSimilarity], result of:
> 5.44288 = score(doc=0,freq=1.0 = termFreq=1.0
> ), product of:
> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 70.0 = docFreq
> 5197.0 = docCount
> 1.2656635 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b
> * fieldLength / avgFieldLength)) from:
> 1.0 = termFreq=1.0
> 1.2 = parameter k1
> 0.75 = parameter b
> 5.2576485 = avgFieldLength
> 2.56 = fieldLength
> 8.171431 = weight(*nameSearch:"12345 masitha"~5 *in 0) [SchemaSimilarity],
> result of:
> 8.171431 = score(doc=0,freq=0.3334 = phraseFreq=0.3334
> ), product of:
> 11.940155 = idf(), sum of:
> 7.6397386 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 2.0 = docFreq
> 5197.0 = docCount
> 4.3004165 = idf, computed as log(1 + (docCount - docFreq + 0.5) / (docFreq
> + 0.5)) from:
> 70.0 = docFreq
> 5197.0 = docCount
> 0.6843655 = tfNorm, computed as (freq * (k1 + 1)) / (freq + k1 * (1 - b + b
> * fieldLength / avgFieldLength)) from:
> 0.3334 = phraseFreq=0.3334
> 1.2 = parameter k1
> 0.75 = parameter b
> 5.2576485 = avgFieldLength
> 2.56 = fieldLength
> 
> Thanks,
> Aman Deep Singh