Re: Solr Boost Search word before Specific Content

2015-07-08 Thread Alessandro Benedetti
Thanks Ahmet for the proposed Solution, that should work, but it is really
hardcoded and coupled with the specific keyword ( "with" in the example) .

I recently read an article from master Doug (
http://opensourceconnections.com/blog/2014/12/08/title-search-when-relevancy-is-only-skin-deep/
) .

I do believe this is the point you should start with.

In particular take extra care of the "Pantheon" approach, which can be
really useful to you.

" … We can use our pantheon along with a KeepWordsFilter
<http://www.elasticsearch.org/guide/en/elasticsearch/reference/current/analysis-keep-words-tokenfilter.html>
 to create yet another search field to use in our search. We can create a
“keep words” list that contains the terms in our pantheon. Only terms in
our list make it into the search index. We can call this field
pantheon_title. For example, when the following title is analyzed to go
into the index:

   - Who was Socrates

we will strip out all terms other than the ones in our pantheon:

   - Socrates

Similarly the title

   - Socrates and Plato on Metaphysics

Can be boiled down to these three members of our pantheon:

   - Socrates Plato Metaphysics"

Hope this can help !

Cheers

2015-07-08 8:09 GMT+01:00 Ahmet Arslan :

> Hi Jack,
>
> Here is hypothetical example:
>
> product_title_1 : dell laptop with laptop bag
>
> product_title_2 : laptop bag with cover
> product_title_3 : laptop bag and table
>
> You create an artificial/additional field,
>
> before_field_1 : dell laptop
> before_field_2 : laptop bag
> before_field_3 : laptop bag
>
> You can implement/embed any complex/custom logic (to indexing code) for
> obtaining values of this new boostable before_field.
> You can even implement it in a custom update processor.
>
> Then, at search time, use (e)Dismax's field boosting mechanism q=Laptop
> bag&qf=product_title^0.3 before_field^0.7&defType=edismax
>
> Ahmet
>
>
>
> On Wednesday, July 8, 2015 6:56 AM, JACK  wrote:
> Hi Ahmet,
>
> Can you elaborate it more?
> Is it possible to solve my problem in Solr 5.0.0?
> if yes can just explain how?
>
>
>
> --
> View this message in context:
> http://lucene.472066.n3.nabble.com/Solr-Boost-Search-word-before-Specific-Content-tp4216072p4216257.html
>
> Sent from the Solr - User mailing list archive at Nabble.com.
>



-- 
--

Benedetti Alessandro
Visiting card : http://about.me/alessandro_benedetti

"Tyger, tyger burning bright
In the forests of the night,
What immortal hand or eye
Could frame thy fearful symmetry?"

William Blake - Songs of Experience -1794 England


Re: Solr Boost Search word before Specific Content

2015-07-08 Thread Ahmet Arslan
Hi Jack,

Here is hypothetical example:

product_title_1 : dell laptop with laptop bag

product_title_2 : laptop bag with cover
product_title_3 : laptop bag and table

You create an artificial/additional field, 

before_field_1 : dell laptop
before_field_2 : laptop bag
before_field_3 : laptop bag

You can implement/embed any complex/custom logic (to indexing code) for 
obtaining values of this new boostable before_field.
You can even implement it in a custom update processor.

Then, at search time, use (e)Dismax's field boosting mechanism q=Laptop 
bag&qf=product_title^0.3 before_field^0.7&defType=edismax

Ahmet



On Wednesday, July 8, 2015 6:56 AM, JACK  wrote:
Hi Ahmet,

Can you elaborate it more?
Is it possible to solve my problem in Solr 5.0.0?
if yes can just explain how?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Boost-Search-word-before-Specific-Content-tp4216072p4216257.html

Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Boost Search word before Specific Content

2015-07-07 Thread JACK
Hi Ahmet,

Can you elaborate it more?
Is it possible to solve my problem in Solr 5.0.0?
if yes can just explain how?



--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Boost-Search-word-before-Specific-Content-tp4216072p4216257.html
Sent from the Solr - User mailing list archive at Nabble.com.


Re: Solr Boost Search word before Specific Content

2015-07-07 Thread Ahmet Arslan
Hi Jack,

You may boost first n words of the product title via something like : 
https://issues.apache.org/jira/browse/SOLR-3925

However, I would create an additional boostable field. You can do this at index 
time in your indexing code.
It will be easy to divide product title into two, and apply boost on the newly 
added field.

Ahmet



On Tuesday, July 7, 2015 11:44 AM, JACK  wrote:
I am using Solr 5.0.0, I have one question in relevance boost:

If I search for laptop table like words, is there any way to boost results
search word before the words like by with or without etc.

I used this query:

? defType = dismax 
& q = foo bar 
& bq = (*:* -by)^999  
But, this will boost negatively those documents having the word by or with
etc. How can i avoid this problem?

For example, if I search for laptop table then by the above query the result
DGB Cooling Laptop Table by GDB won't boost.

I just need to give a boost to the search words before certain words like
by, with, etc. Is it possible?

Example 2

If i search for Laptop bag 
It should boost and return Results having search words before these words
with,by,without,etc first.

Lets say 
dell laptop with laptop bag
laptop bag with cover
laptop bag and table

Results like

laptop bag with cover
laptop bag and table
dell laptop without laptop bag, 
In the Results search word laptop bag is before with, without,and. Search
results containing search word before these word should come first. 





--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Boost-Search-word-before-Specific-Content-tp4216072.html
Sent from the Solr - User mailing list archive at Nabble.com.


Solr Boost Search word before Specific Content

2015-07-07 Thread JACK
I am using Solr 5.0.0, I have one question in relevance boost:

If I search for laptop table like words, is there any way to boost results
search word before the words like by with or without etc.

I used this query:

? defType = dismax 
& q = foo bar 
& bq = (*:* -by)^999  
But, this will boost negatively those documents having the word by or with
etc. How can i avoid this problem?

For example, if I search for laptop table then by the above query the result
DGB Cooling Laptop Table by GDB won't boost.

I just need to give a boost to the search words before certain words like
by, with, etc. Is it possible?

Example 2

If i search for Laptop bag 
It should boost and return Results having search words before these words
with,by,without,etc first.

Lets say 
dell laptop with laptop bag
laptop bag with cover
laptop bag and table

Results like

laptop bag with cover
laptop bag and table
dell laptop without laptop bag, 
In the Results search word laptop bag is before with, without,and. Search
results containing search word before these word should come first. 





--
View this message in context: 
http://lucene.472066.n3.nabble.com/Solr-Boost-Search-word-before-Specific-Content-tp4216072.html
Sent from the Solr - User mailing list archive at Nabble.com.