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 aniljayanti <an...@yahoo.co.in> on 2015/10/06 09:08:37 UTC

Filter first-components result in solr.SearchHandler

Hi All,

I am workng on solr 5.2.1. I wrote my own component to get employee id's
from first-component. I am trying to pass these id's to normal
solr.SearchHandler (<requestHandler name="/select"
class="solr.SearchHandler">) to filter the employee id's.

relevant request handler in solrconfig.xml file : 

<searchComponent name="custom-priority"
class="org.apache.solr.handler.component.ext.imiCustomPriority"/>

  <requestHandler name="/select" class="solr.SearchHandler">
    <lst name="defaults">
      <str name="echoParams">explicit</str>
      <int name="rows">100</int>
      <str name="df">text</str>
    </lst>

    <arr name="first-components">
	  <str>custom-priority</str>
    </arr> 
  </requestHandler>

How I can pass employee id's in qf param correctly in query so that solr can
use this while searching ? 

Suggestions are appreciated..

 thanks in advance

AnilJayanti




--
View this message in context: http://lucene.472066.n3.nabble.com/Filter-first-components-result-in-solr-SearchHandler-tp4232892.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Filter first-components result in solr.SearchHandler

Posted by Erik Hatcher <er...@gmail.com>.
Seems like Solr’s QueryElevationComponent is what would suit your needs here.

Or, perhaps, adding something like this to your request:  bq={!terms f=id}3,5,6,8,9


—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>




> On Oct 6, 2015, at 7:45 AM, aniljayanti <an...@yahoo.co.in> wrote:
> 
> Hi Erik,
> 
> thanks for your response, let me explain briefly.
> 
> i wanted to make 5 employee id's as a priority id's. so every time when i am
> searching with specific keyword, then i want to append these 5 employee id's
> as first 5 results to the search results.
> 
> example : 
> 
> let's take 3,5,6,8,9 are priority employee id's.
> when i am searching with specific keyword then got 4 docs (employee id's are
> 1,2,4,7) as results. 
> then i want to display the final result as below.
> 
> final result : 3,5,6,8,9,1,2,4,7
> 
> Please suggest me.
> 
> Thanks.
> 
> AnilJayanti
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Filter-first-components-result-in-solr-SearchHandler-tp4232892p4232926.html
> Sent from the Solr - User mailing list archive at Nabble.com.


Re: Filter first-components result in solr.SearchHandler

Posted by aniljayanti <an...@yahoo.co.in>.
Hi Erik,

thanks for your response, let me explain briefly.

i wanted to make 5 employee id's as a priority id's. so every time when i am
searching with specific keyword, then i want to append these 5 employee id's
as first 5 results to the search results.

example : 

let's take 3,5,6,8,9 are priority employee id's.
when i am searching with specific keyword then got 4 docs (employee id's are
1,2,4,7) as results. 
then i want to display the final result as below.

final result : 3,5,6,8,9,1,2,4,7

Please suggest me.

Thanks.

AnilJayanti



--
View this message in context: http://lucene.472066.n3.nabble.com/Filter-first-components-result-in-solr-SearchHandler-tp4232892p4232926.html
Sent from the Solr - User mailing list archive at Nabble.com.

Re: Filter first-components result in solr.SearchHandler

Posted by Erik Hatcher <er...@gmail.com>.
Could you also provide an example of the type of request you want the client to make?

Note that `qf` is a (e)dismax query parser parameter, in case that’s conflicting for you.

—
Erik Hatcher, Senior Solutions Architect
http://www.lucidworks.com <http://www.lucidworks.com/>




> On Oct 6, 2015, at 3:08 AM, aniljayanti <an...@yahoo.co.in> wrote:
> 
> Hi All,
> 
> I am workng on solr 5.2.1. I wrote my own component to get employee id's
> from first-component. I am trying to pass these id's to normal
> solr.SearchHandler (<requestHandler name="/select"
> class="solr.SearchHandler">) to filter the employee id's.
> 
> relevant request handler in solrconfig.xml file : 
> 
> <searchComponent name="custom-priority"
> class="org.apache.solr.handler.component.ext.imiCustomPriority"/>
> 
>  <requestHandler name="/select" class="solr.SearchHandler">
>    <lst name="defaults">
>      <str name="echoParams">explicit</str>
>      <int name="rows">100</int>
>      <str name="df">text</str>
>    </lst>
> 
>    <arr name="first-components">
> 	  <str>custom-priority</str>
>    </arr> 
>  </requestHandler>
> 
> How I can pass employee id's in qf param correctly in query so that solr can
> use this while searching ? 
> 
> Suggestions are appreciated..
> 
> thanks in advance
> 
> AnilJayanti
> 
> 
> 
> 
> --
> View this message in context: http://lucene.472066.n3.nabble.com/Filter-first-components-result-in-solr-SearchHandler-tp4232892.html
> Sent from the Solr - User mailing list archive at Nabble.com.