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 Julian Davchev <jm...@drun.net> on 2009/06/23 16:27:23 UTC

building custom RequestHandlers

I am using solr and php quite nicely.
Currently the work flow includes some manipulation on php side so I
correctly format the query string and pass to tomcat/solr.
I somehow want to build own request handler in java so I skip the whole
apache/php request that is just for formating.
This will saves me tons of requests to apache since I use solr directly
from javascript.

Would like to ask if there is something ready that I can use and adjust.
I am kinda new in Java but once I get the pointers
I think should be able to pull out.
Thanks,
JD



Re: building custom RequestHandlers

Posted by Chris Hostetter <ho...@fucit.org>.
: So question is howto extend the class.... where to place the file, howto
: recomplie, set in solrconfig.xml etc... so that it's all glued together
: and can make use of it.

I would start here...
http://wiki.apache.org/solr/SolrPlugins

...and then ask specific questions as you encounter them.




-Hoss


Re: building custom RequestHandlers

Posted by Julian Davchev <jm...@drun.net>.
I am not sure we talk about same thing at all. I want to extend solr
(java)  so that I have another request handler in java
And I can do for example      /select?qt=myhandler&q=querystring

Then in this myhandler class in java ot whoever I will parse querystring
so I build the final correct query to pass to the engine.

So question is howto extend the class.... where to place the file, howto
recomplie, set in solrconfig.xml etc... so that it's all glued together
and can make use of it.

Bill Dueber wrote:
> Is it possible to change the javascript  output? I find some of the
> information choices (e.g., that facet information is returned in a flat
> list, with facet names in the even-numbered indexes and number-of-items
> following them in the odd-numbered indexes) kind of annoying.
>
> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <epugh@opensourceconnections.com
>   
>> wrote:
>>     
>
>   
>> Like most things JavaScript, I found that I had to just dig through it and
>> play with it.  However, the Reuters demo site was very easy to customize to
>> interact with my own Solr instance, and I went from there.
>>
>>
>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>>
>>  Never used it.. I am just looking in docs how can I extend solr but no
>>     
>>> luck so far :(
>>> Hoping for some docs or real extend example.
>>>
>>>
>>>
>>> Eric Pugh wrote:
>>>
>>>       
>>>> Are you using the JavaScript interface to Solr?
>>>> http://wiki.apache.org/solr/SolrJS
>>>>
>>>> It may provide much of what you are looking for!
>>>>
>>>> Eric
>>>>
>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>>
>>>>  I am using solr and php quite nicely.
>>>>         
>>>>> Currently the work flow includes some manipulation on php side so I
>>>>> correctly format the query string and pass to tomcat/solr.
>>>>> I somehow want to build own request handler in java so I skip the whole
>>>>> apache/php request that is just for formating.
>>>>> This will saves me tons of requests to apache since I use solr directly
>>>>> from javascript.
>>>>>
>>>>> Would like to ask if there is something ready that I can use and adjust.
>>>>> I am kinda new in Java but once I get the pointers
>>>>> I think should be able to pull out.
>>>>> Thanks,
>>>>> JD
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> -----------------------------------------------------
>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>> http://www.opensourceconnections.com
>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>         
>> -----------------------------------------------------
>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>> http://www.opensourceconnections.com
>> Free/Busy: http://tinyurl.com/eric-cal
>>
>>
>>
>>
>>
>>     
>
>
>   


Re: building custom RequestHandlers

Posted by Julian Davchev <jm...@drun.net>.
Great thank you.

Mats Lindh wrote:
> I wrote a small post regarding how to create an analysis filter about a year
> ago. I'm guessing that the process is quite similar when developing a custom
> request handler:
>
> http://e-mats.org/2008/06/writing-a-solr-analysis-filter-plugin/
>
> Hope that helps.
>
> --mats
>
> On Wed, Jun 24, 2009 at 12:54 PM, Julian Davchev <jm...@drun.net> wrote:
>
>   
>> Well it's really lovely whats in there but this is just configuration
>> aspect. Is there sample where should I place my class etc
>> and howto complie and all. just simple top to bottom example.  I guess
>> most of those aspects might be java but they are solr related as well.
>>
>> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>>     
>>> this part of the doc explains what you shold do to write a custom
>>>       
>> requesthandler
>>     
>>>       
>> http://wiki.apache.org/solr/SolrPlugins#head-7c0d03515c496017f6c0116ebb096e34a872cb61
>>     
>>> On Wed, Jun 24, 2009 at 3:35 AM, Julian Davchev<jm...@drun.net> wrote:
>>>
>>>       
>>>> Is it just me or this is thread steal? nothing todo with what thread is
>>>> originally about.
>>>> Cheers
>>>>
>>>> Bill Dueber wrote:
>>>>
>>>>         
>>>>> Is it possible to change the javascript  output? I find some of the
>>>>> information choices (e.g., that facet information is returned in a flat
>>>>> list, with facet names in the even-numbered indexes and number-of-items
>>>>> following them in the odd-numbered indexes) kind of annoying.
>>>>>
>>>>> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <
>>>>>           
>> epugh@opensourceconnections.com
>>     
>>>>>           
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>             
>>>>>> Like most things JavaScript, I found that I had to just dig through it
>>>>>>             
>> and
>>     
>>>>>> play with it.  However, the Reuters demo site was very easy to
>>>>>>             
>> customize to
>>     
>>>>>> interact with my own Solr instance, and I went from there.
>>>>>>
>>>>>>
>>>>>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>>>>>>
>>>>>>  Never used it.. I am just looking in docs how can I extend solr but
>>>>>>             
>> no
>>     
>>>>>>             
>>>>>>> luck so far :(
>>>>>>> Hoping for some docs or real extend example.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Eric Pugh wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Are you using the JavaScript interface to Solr?
>>>>>>>> http://wiki.apache.org/solr/SolrJS
>>>>>>>>
>>>>>>>> It may provide much of what you are looking for!
>>>>>>>>
>>>>>>>> Eric
>>>>>>>>
>>>>>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>>>>>>
>>>>>>>>  I am using solr and php quite nicely.
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>>>> Currently the work flow includes some manipulation on php side so I
>>>>>>>>> correctly format the query string and pass to tomcat/solr.
>>>>>>>>> I somehow want to build own request handler in java so I skip the
>>>>>>>>>                   
>> whole
>>     
>>>>>>>>> apache/php request that is just for formating.
>>>>>>>>> This will saves me tons of requests to apache since I use solr
>>>>>>>>>                   
>> directly
>>     
>>>>>>>>> from javascript.
>>>>>>>>>
>>>>>>>>> Would like to ask if there is something ready that I can use and
>>>>>>>>>                   
>> adjust.
>>     
>>>>>>>>> I am kinda new in Java but once I get the pointers
>>>>>>>>> I think should be able to pull out.
>>>>>>>>> Thanks,
>>>>>>>>> JD
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                   
>>>>>>>> -----------------------------------------------------
>>>>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>>>>>> http://www.opensourceconnections.com
>>>>>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>> -----------------------------------------------------
>>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>>>> http://www.opensourceconnections.com
>>>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>           
>>>
>>>
>>>       
>>     
>
>   


Re: building custom RequestHandlers

Posted by Julian Davchev <jm...@drun.net>.
Ok, I glued all stuff  and ended up extending
handler.component.SearchHandler    cause  I wan to use all it's
functionlity only toadjust the q param before it gets preocessed.
 
How exactly can I get the q and set it back later?
>From digging code it seems thats the way....

SolrParams p = req.getParams();
String words = p.get("q");

but I get SolrParams    is depricated  and type mismatch cannot convert
SolrParams to SolrParams  

even like this
SolrParams p = (SolrParams) req.getParams();

I get error and 500 when trying to use it.

Any pointers to howto set and get are more than welcome.   at end of it
I am using super.handleRequestBody(req, rsp);   so no other stuff to mess.



Mats Lindh wrote:
> I wrote a small post regarding how to create an analysis filter about a year
> ago. I'm guessing that the process is quite similar when developing a custom
> request handler:
>
> http://e-mats.org/2008/06/writing-a-solr-analysis-filter-plugin/
>
> Hope that helps.
>
> --mats
>
> On Wed, Jun 24, 2009 at 12:54 PM, Julian Davchev <jm...@drun.net> wrote:
>
>   
>> Well it's really lovely whats in there but this is just configuration
>> aspect. Is there sample where should I place my class etc
>> and howto complie and all. just simple top to bottom example.  I guess
>> most of those aspects might be java but they are solr related as well.
>>
>> Noble Paul നോബിള്‍ नोब्ळ् wrote:
>>     
>>> this part of the doc explains what you shold do to write a custom
>>>       
>> requesthandler
>>     
>>>       
>> http://wiki.apache.org/solr/SolrPlugins#head-7c0d03515c496017f6c0116ebb096e34a872cb61
>>     
>>> On Wed, Jun 24, 2009 at 3:35 AM, Julian Davchev<jm...@drun.net> wrote:
>>>
>>>       
>>>> Is it just me or this is thread steal? nothing todo with what thread is
>>>> originally about.
>>>> Cheers
>>>>
>>>> Bill Dueber wrote:
>>>>
>>>>         
>>>>> Is it possible to change the javascript  output? I find some of the
>>>>> information choices (e.g., that facet information is returned in a flat
>>>>> list, with facet names in the even-numbered indexes and number-of-items
>>>>> following them in the odd-numbered indexes) kind of annoying.
>>>>>
>>>>> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <
>>>>>           
>> epugh@opensourceconnections.com
>>     
>>>>>           
>>>>>> wrote:
>>>>>>
>>>>>>
>>>>>>             
>>>>>> Like most things JavaScript, I found that I had to just dig through it
>>>>>>             
>> and
>>     
>>>>>> play with it.  However, the Reuters demo site was very easy to
>>>>>>             
>> customize to
>>     
>>>>>> interact with my own Solr instance, and I went from there.
>>>>>>
>>>>>>
>>>>>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>>>>>>
>>>>>>  Never used it.. I am just looking in docs how can I extend solr but
>>>>>>             
>> no
>>     
>>>>>>             
>>>>>>> luck so far :(
>>>>>>> Hoping for some docs or real extend example.
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>> Eric Pugh wrote:
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>>>> Are you using the JavaScript interface to Solr?
>>>>>>>> http://wiki.apache.org/solr/SolrJS
>>>>>>>>
>>>>>>>> It may provide much of what you are looking for!
>>>>>>>>
>>>>>>>> Eric
>>>>>>>>
>>>>>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>>>>>>
>>>>>>>>  I am using solr and php quite nicely.
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>>>>> Currently the work flow includes some manipulation on php side so I
>>>>>>>>> correctly format the query string and pass to tomcat/solr.
>>>>>>>>> I somehow want to build own request handler in java so I skip the
>>>>>>>>>                   
>> whole
>>     
>>>>>>>>> apache/php request that is just for formating.
>>>>>>>>> This will saves me tons of requests to apache since I use solr
>>>>>>>>>                   
>> directly
>>     
>>>>>>>>> from javascript.
>>>>>>>>>
>>>>>>>>> Would like to ask if there is something ready that I can use and
>>>>>>>>>                   
>> adjust.
>>     
>>>>>>>>> I am kinda new in Java but once I get the pointers
>>>>>>>>> I think should be able to pull out.
>>>>>>>>> Thanks,
>>>>>>>>> JD
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>
>>>>>>>>>                   
>>>>>>>> -----------------------------------------------------
>>>>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>>>>>> http://www.opensourceconnections.com
>>>>>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>
>>>>>>>>                 
>>>>>> -----------------------------------------------------
>>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>>>> http://www.opensourceconnections.com
>>>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>>>           
>>>
>>>
>>>       
>>     
>
>   


Re: custom RequestHandler to extend SolrSearch. howto set/get q param

Posted by Julian Davchev <jm...@drun.net>.
After digging even more I ended up building query parser. Now I am
extending org.apache.solr.search.LuceneQParserPlugin

All looks smooth and working just kinda bugged by INFO debug message

qstr = qstr + "aaaaaaa";//...seems to change really the query

But I am confused by
public QParser createParser(String qstr, SolrParams localParams,
SolrParams params, SolrQueryRequest req)

there is   localParams params, qstr, req              which all by some
form contains query string. Even if I change them all to modify q and
all....... I still end up having

INFO: [] webapp=/blah-en path=/select/
params={fl=*&q=germany&qt=dismax&rows=43} hits=492 status=0 QTime=516


with q=germany and not q=germanyaaaaaaa

I have no clue if this might have some real impact or just changing qstr
is enough.



Julian Davchev wrote:
> Hi,
> Thanks.
>
> 1. Although I do set q I don't see q overwritten so it's processed with
> new setting though.
> Example I add aaaaaaaa... to the query and here what I debug of q     in
> log/catalina.out
>
> Qparam: germanyaaaaaaaaaaaaaaaaaaa
> Jun 26, 2009 10:00:37 AM org.apache.solr.core.SolrCore execute
> INFO: [] webapp=/blah-en path=/select/
> params={fl=*&q=germany&qt=dismax&rows=43} hits=492 status=0 QTime=516
>
>
> From what I see in INFO  the q=germany and NOT       
> q=germanyaaaaaaaaaaaaaaaaaaa as I would expect. So real query executed
> is still original q.
>
> Is there some other point that I should plug into or another way to set
> the param?
>
> 2. On side note. SearchHandler is too generic as I get stuff like this
> during start of tomcat.
>
> Qparam: static firstSearcher warming query from
> solrconfig.xmlaaaaaaaaaaaaaaaaaaa
>
> which seems like internal queries also pass through
> SearchHandler::handleRequestBody() That is not that great of issue..I
> can  just pass extra command and process only those (making sure it's my
> query).
>
>
> I reallize those seems small questions and probably sound stupid but I
> just cannot find manual howto handle those properly.
>
>
> Mark Miller wrote:
>   
>> Julian Davchev wrote:
>>     
>>> Mark Miller wrote:
>>>  
>>>       
>>>> Rather than using org.apache.solr.request.SolrParams, try using
>>>> org.apache.solr.common.params.SolrParms.
>>>>
>>>>     
>>>>         
>>> Thanks that really helped. One final issue to solve.    I don't see
>>> SolrParams.set()     which I guess is normal but how can I
>>> modify the q param before I pass it further for processing.
>>> Basically I got...
>>>
>>>         SolrParams p = req.getParams();
>>>         String words = p.get("q");
>>>         //do something with words....                   //assign
>>> words back to q param so that the processing is on
>>> modified q?  What is recommended way to do this?
>>>
>>> Thanks
>>>   
>>>       
>> You might try:
>>
>> SolrParams p = req.getParams();
>> String words = p.get("q");
>> ModifiableSolrParams newParams = new ModifiableSolrParams(p)
>> newParams.set("q", words + stuff);
>> req.setParams(newParams);
>>
>>
>>     
>
>   


Re: custom RequestHandler to extend SolrSearch. howto set/get q param

Posted by Julian Davchev <jm...@drun.net>.
Hi,
Thanks.

1. Although I do set q I don't see q overwritten so it's processed with
new setting though.
Example I add aaaaaaaa... to the query and here what I debug of q     in
log/catalina.out

Qparam: germanyaaaaaaaaaaaaaaaaaaa
Jun 26, 2009 10:00:37 AM org.apache.solr.core.SolrCore execute
INFO: [] webapp=/blah-en path=/select/
params={fl=*&q=germany&qt=dismax&rows=43} hits=492 status=0 QTime=516


>From what I see in INFO  the q=germany and NOT       
q=germanyaaaaaaaaaaaaaaaaaaa as I would expect. So real query executed
is still original q.

Is there some other point that I should plug into or another way to set
the param?

2. On side note. SearchHandler is too generic as I get stuff like this
during start of tomcat.

Qparam: static firstSearcher warming query from
solrconfig.xmlaaaaaaaaaaaaaaaaaaa

which seems like internal queries also pass through
SearchHandler::handleRequestBody() That is not that great of issue..I
can  just pass extra command and process only those (making sure it's my
query).


I reallize those seems small questions and probably sound stupid but I
just cannot find manual howto handle those properly.


Mark Miller wrote:
> Julian Davchev wrote:
>> Mark Miller wrote:
>>  
>>> Rather than using org.apache.solr.request.SolrParams, try using
>>> org.apache.solr.common.params.SolrParms.
>>>
>>>     
>> Thanks that really helped. One final issue to solve.    I don't see
>> SolrParams.set()     which I guess is normal but how can I
>> modify the q param before I pass it further for processing.
>> Basically I got...
>>
>>         SolrParams p = req.getParams();
>>         String words = p.get("q");
>>         //do something with words....                   //assign
>> words back to q param so that the processing is on
>> modified q?  What is recommended way to do this?
>>
>> Thanks
>>   
> You might try:
>
> SolrParams p = req.getParams();
> String words = p.get("q");
> ModifiableSolrParams newParams = new ModifiableSolrParams(p)
> newParams.set("q", words + stuff);
> req.setParams(newParams);
>
>


Re: custom RequestHandler to extend SolrSearch. howto set/get q param

Posted by Mark Miller <ma...@gmail.com>.
Julian Davchev wrote:
> Mark Miller wrote:
>   
>> Rather than using org.apache.solr.request.SolrParams, try using
>> org.apache.solr.common.params.SolrParms.
>>
>>     
> Thanks that really helped. One final issue to solve.    I don't see
> SolrParams.set()     which I guess is normal but how can I
> modify the q param before I pass it further for processing.
> Basically I got...
>
>         SolrParams p = req.getParams();
>         String words = p.get("q");
>         //do something with words....           
>         //assign words back to q param so that the processing is on
> modified q?  What is recommended way to do this?
>
> Thanks
>   
You might try:

SolrParams p = req.getParams();
String words = p.get("q");
ModifiableSolrParams newParams = new ModifiableSolrParams(p)
newParams.set("q", words + stuff);
req.setParams(newParams);


-- 
- Mark

http://www.lucidimagination.com




Re: custom RequestHandler to extend SolrSearch. howto set/get q param

Posted by Julian Davchev <jm...@drun.net>.
Mark Miller wrote:
> Rather than using org.apache.solr.request.SolrParams, try using
> org.apache.solr.common.params.SolrParms.
>
Thanks that really helped. One final issue to solve.    I don't see
SolrParams.set()     which I guess is normal but how can I
modify the q param before I pass it further for processing.
Basically I got...

        SolrParams p = req.getParams();
        String words = p.get("q");
        //do something with words....           
        //assign words back to q param so that the processing is on
modified q?  What is recommended way to do this?

Thanks

Re: custom RequestHandler to extend SolrSearch. howto set/get q param

Posted by Mark Miller <ma...@gmail.com>.
Rather than using org.apache.solr.request.SolrParams, try using 
org.apache.solr.common.params.SolrParms.

-- 
- Mark

http://www.lucidimagination.com



Julian Davchev wrote:
> Hi devs,
>
> I am not sure if mailing list is for solr developers only or include
> extending solr as well.
>
>
> I ended up building own plugin(class) which extends
> handler.component.SearchHandler    cause  I wan to use all it's
> functionlity only to adjust the q param before it gets preocessed.
>
> How exactly can I get the q and set it back later?
> From digging code it seems thats the way....
>
> SolrParams p = req.getParams();
> String words = p.get("q");
>
> but I get SolrParams    is depricated  and type mismatch cannot convert
> SolrParams to SolrParams
>
> even like this
> SolrParams p = (SolrParams) req.getParams();
>
> I get error and 500 when trying to use it.
>
> Any pointers to howto set and get are more than welcome.   at end of it
> I am using super.handleRequestBody(req, rsp);   so no other stuff to mess.
>
>
> Again, sorry if this mailing list is not for user development issues.
>
> Bug free,
> JD
>   



custom RequestHandler to extend SolrSearch. howto set/get q param

Posted by Julian Davchev <jm...@drun.net>.
Hi devs,

I am not sure if mailing list is for solr developers only or include
extending solr as well.


I ended up building own plugin(class) which extends
handler.component.SearchHandler    cause  I wan to use all it's
functionlity only to adjust the q param before it gets preocessed.

How exactly can I get the q and set it back later?
>From digging code it seems thats the way....

SolrParams p = req.getParams();
String words = p.get("q");

but I get SolrParams    is depricated  and type mismatch cannot convert
SolrParams to SolrParams

even like this
SolrParams p = (SolrParams) req.getParams();

I get error and 500 when trying to use it.

Any pointers to howto set and get are more than welcome.   at end of it
I am using super.handleRequestBody(req, rsp);   so no other stuff to mess.


Again, sorry if this mailing list is not for user development issues.

Bug free,
JD

Re: building custom RequestHandlers

Posted by Mats Lindh <ma...@gmail.com>.
I wrote a small post regarding how to create an analysis filter about a year
ago. I'm guessing that the process is quite similar when developing a custom
request handler:

http://e-mats.org/2008/06/writing-a-solr-analysis-filter-plugin/

Hope that helps.

--mats

On Wed, Jun 24, 2009 at 12:54 PM, Julian Davchev <jm...@drun.net> wrote:

> Well it's really lovely whats in there but this is just configuration
> aspect. Is there sample where should I place my class etc
> and howto complie and all. just simple top to bottom example.  I guess
> most of those aspects might be java but they are solr related as well.
>
> Noble Paul നോബിള്‍ नोब्ळ् wrote:
> > this part of the doc explains what you shold do to write a custom
> requesthandler
> >
> >
> http://wiki.apache.org/solr/SolrPlugins#head-7c0d03515c496017f6c0116ebb096e34a872cb61
> >
> > On Wed, Jun 24, 2009 at 3:35 AM, Julian Davchev<jm...@drun.net> wrote:
> >
> >> Is it just me or this is thread steal? nothing todo with what thread is
> >> originally about.
> >> Cheers
> >>
> >> Bill Dueber wrote:
> >>
> >>> Is it possible to change the javascript  output? I find some of the
> >>> information choices (e.g., that facet information is returned in a flat
> >>> list, with facet names in the even-numbered indexes and number-of-items
> >>> following them in the odd-numbered indexes) kind of annoying.
> >>>
> >>> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <
> epugh@opensourceconnections.com
> >>>
> >>>
> >>>> wrote:
> >>>>
> >>>>
> >>>
> >>>> Like most things JavaScript, I found that I had to just dig through it
> and
> >>>> play with it.  However, the Reuters demo site was very easy to
> customize to
> >>>> interact with my own Solr instance, and I went from there.
> >>>>
> >>>>
> >>>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
> >>>>
> >>>>  Never used it.. I am just looking in docs how can I extend solr but
> no
> >>>>
> >>>>
> >>>>> luck so far :(
> >>>>> Hoping for some docs or real extend example.
> >>>>>
> >>>>>
> >>>>>
> >>>>> Eric Pugh wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Are you using the JavaScript interface to Solr?
> >>>>>> http://wiki.apache.org/solr/SolrJS
> >>>>>>
> >>>>>> It may provide much of what you are looking for!
> >>>>>>
> >>>>>> Eric
> >>>>>>
> >>>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
> >>>>>>
> >>>>>>  I am using solr and php quite nicely.
> >>>>>>
> >>>>>>
> >>>>>>> Currently the work flow includes some manipulation on php side so I
> >>>>>>> correctly format the query string and pass to tomcat/solr.
> >>>>>>> I somehow want to build own request handler in java so I skip the
> whole
> >>>>>>> apache/php request that is just for formating.
> >>>>>>> This will saves me tons of requests to apache since I use solr
> directly
> >>>>>>> from javascript.
> >>>>>>>
> >>>>>>> Would like to ask if there is something ready that I can use and
> adjust.
> >>>>>>> I am kinda new in Java but once I get the pointers
> >>>>>>> I think should be able to pull out.
> >>>>>>> Thanks,
> >>>>>>> JD
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>> -----------------------------------------------------
> >>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> >>>>>> http://www.opensourceconnections.com
> >>>>>> Free/Busy: http://tinyurl.com/eric-cal
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>> -----------------------------------------------------
> >>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> >>>> http://www.opensourceconnections.com
> >>>> Free/Busy: http://tinyurl.com/eric-cal
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >
> >
> >
> >
>
>

Re: building custom RequestHandlers

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
On Wed, Jun 24, 2009 at 4:24 PM, Julian Davchev <jm...@drun.net> wrote:

> Well it's really lovely whats in there but this is just configuration
> aspect. Is there sample where should I place my class etc
> and howto complie and all. just simple top to bottom example.  I guess
> most of those aspects might be java but they are solr related as well.


I would look at one of the existing requesthandlers in the  codebase and
copy the code and edit whatever is required.

once you are done w/ the code you can build it to a .jar file and drop it in
the <solr_home>/lib directoryt


>
> Noble Paul നോബിള്‍ नोब्ळ् wrote:
> > this part of the doc explains what you shold do to write a custom
> requesthandler
> >
> >
> http://wiki.apache.org/solr/SolrPlugins#head-7c0d03515c496017f6c0116ebb096e34a872cb61
> >
> > On Wed, Jun 24, 2009 at 3:35 AM, Julian Davchev<jm...@drun.net> wrote:
> >
> >> Is it just me or this is thread steal? nothing todo with what thread is
> >> originally about.
> >> Cheers
> >>
> >> Bill Dueber wrote:
> >>
> >>> Is it possible to change the javascript  output? I find some of the
> >>> information choices (e.g., that facet information is returned in a flat
> >>> list, with facet names in the even-numbered indexes and number-of-items
> >>> following them in the odd-numbered indexes) kind of annoying.
> >>>
> >>> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <
> epugh@opensourceconnections.com
> >>>
> >>>
> >>>> wrote:
> >>>>
> >>>>
> >>>
> >>>> Like most things JavaScript, I found that I had to just dig through it
> and
> >>>> play with it.  However, the Reuters demo site was very easy to
> customize to
> >>>> interact with my own Solr instance, and I went from there.
> >>>>
> >>>>
> >>>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
> >>>>
> >>>>  Never used it.. I am just looking in docs how can I extend solr but
> no
> >>>>
> >>>>
> >>>>> luck so far :(
> >>>>> Hoping for some docs or real extend example.
> >>>>>
> >>>>>
> >>>>>
> >>>>> Eric Pugh wrote:
> >>>>>
> >>>>>
> >>>>>
> >>>>>> Are you using the JavaScript interface to Solr?
> >>>>>> http://wiki.apache.org/solr/SolrJS
> >>>>>>
> >>>>>> It may provide much of what you are looking for!
> >>>>>>
> >>>>>> Eric
> >>>>>>
> >>>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
> >>>>>>
> >>>>>>  I am using solr and php quite nicely.
> >>>>>>
> >>>>>>
> >>>>>>> Currently the work flow includes some manipulation on php side so I
> >>>>>>> correctly format the query string and pass to tomcat/solr.
> >>>>>>> I somehow want to build own request handler in java so I skip the
> whole
> >>>>>>> apache/php request that is just for formating.
> >>>>>>> This will saves me tons of requests to apache since I use solr
> directly
> >>>>>>> from javascript.
> >>>>>>>
> >>>>>>> Would like to ask if there is something ready that I can use and
> adjust.
> >>>>>>> I am kinda new in Java but once I get the pointers
> >>>>>>> I think should be able to pull out.
> >>>>>>> Thanks,
> >>>>>>> JD
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>>>
> >>>>>> -----------------------------------------------------
> >>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> >>>>>> http://www.opensourceconnections.com
> >>>>>> Free/Busy: http://tinyurl.com/eric-cal
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>>>>
> >>>> -----------------------------------------------------
> >>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> >>>> http://www.opensourceconnections.com
> >>>> Free/Busy: http://tinyurl.com/eric-cal
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>>
> >>>
> >>>
> >>
> >
> >
> >
> >
>
>


-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: building custom RequestHandlers

Posted by Julian Davchev <jm...@drun.net>.
Well it's really lovely whats in there but this is just configuration
aspect. Is there sample where should I place my class etc
and howto complie and all. just simple top to bottom example.  I guess
most of those aspects might be java but they are solr related as well.

Noble Paul നോബിള്‍ नोब्ळ् wrote:
> this part of the doc explains what you shold do to write a custom requesthandler
>
> http://wiki.apache.org/solr/SolrPlugins#head-7c0d03515c496017f6c0116ebb096e34a872cb61
>
> On Wed, Jun 24, 2009 at 3:35 AM, Julian Davchev<jm...@drun.net> wrote:
>   
>> Is it just me or this is thread steal? nothing todo with what thread is
>> originally about.
>> Cheers
>>
>> Bill Dueber wrote:
>>     
>>> Is it possible to change the javascript  output? I find some of the
>>> information choices (e.g., that facet information is returned in a flat
>>> list, with facet names in the even-numbered indexes and number-of-items
>>> following them in the odd-numbered indexes) kind of annoying.
>>>
>>> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <epugh@opensourceconnections.com
>>>
>>>       
>>>> wrote:
>>>>
>>>>         
>>>       
>>>> Like most things JavaScript, I found that I had to just dig through it and
>>>> play with it.  However, the Reuters demo site was very easy to customize to
>>>> interact with my own Solr instance, and I went from there.
>>>>
>>>>
>>>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>>>>
>>>>  Never used it.. I am just looking in docs how can I extend solr but no
>>>>
>>>>         
>>>>> luck so far :(
>>>>> Hoping for some docs or real extend example.
>>>>>
>>>>>
>>>>>
>>>>> Eric Pugh wrote:
>>>>>
>>>>>
>>>>>           
>>>>>> Are you using the JavaScript interface to Solr?
>>>>>> http://wiki.apache.org/solr/SolrJS
>>>>>>
>>>>>> It may provide much of what you are looking for!
>>>>>>
>>>>>> Eric
>>>>>>
>>>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>>>>
>>>>>>  I am using solr and php quite nicely.
>>>>>>
>>>>>>             
>>>>>>> Currently the work flow includes some manipulation on php side so I
>>>>>>> correctly format the query string and pass to tomcat/solr.
>>>>>>> I somehow want to build own request handler in java so I skip the whole
>>>>>>> apache/php request that is just for formating.
>>>>>>> This will saves me tons of requests to apache since I use solr directly
>>>>>>> from javascript.
>>>>>>>
>>>>>>> Would like to ask if there is something ready that I can use and adjust.
>>>>>>> I am kinda new in Java but once I get the pointers
>>>>>>> I think should be able to pull out.
>>>>>>> Thanks,
>>>>>>> JD
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>
>>>>>>>               
>>>>>> -----------------------------------------------------
>>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>>>> http://www.opensourceconnections.com
>>>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>>>             
>>>> -----------------------------------------------------
>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>> http://www.opensourceconnections.com
>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>         
>>>
>>>       
>>     
>
>
>
>   


Re: building custom RequestHandlers

Posted by Noble Paul നോബിള്‍ नोब्ळ् <no...@corp.aol.com>.
this part of the doc explains what you shold do to write a custom requesthandler

http://wiki.apache.org/solr/SolrPlugins#head-7c0d03515c496017f6c0116ebb096e34a872cb61

On Wed, Jun 24, 2009 at 3:35 AM, Julian Davchev<jm...@drun.net> wrote:
> Is it just me or this is thread steal? nothing todo with what thread is
> originally about.
> Cheers
>
> Bill Dueber wrote:
>> Is it possible to change the javascript  output? I find some of the
>> information choices (e.g., that facet information is returned in a flat
>> list, with facet names in the even-numbered indexes and number-of-items
>> following them in the odd-numbered indexes) kind of annoying.
>>
>> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <epugh@opensourceconnections.com
>>
>>> wrote:
>>>
>>
>>
>>> Like most things JavaScript, I found that I had to just dig through it and
>>> play with it.  However, the Reuters demo site was very easy to customize to
>>> interact with my own Solr instance, and I went from there.
>>>
>>>
>>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>>>
>>>  Never used it.. I am just looking in docs how can I extend solr but no
>>>
>>>> luck so far :(
>>>> Hoping for some docs or real extend example.
>>>>
>>>>
>>>>
>>>> Eric Pugh wrote:
>>>>
>>>>
>>>>> Are you using the JavaScript interface to Solr?
>>>>> http://wiki.apache.org/solr/SolrJS
>>>>>
>>>>> It may provide much of what you are looking for!
>>>>>
>>>>> Eric
>>>>>
>>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>>>
>>>>>  I am using solr and php quite nicely.
>>>>>
>>>>>> Currently the work flow includes some manipulation on php side so I
>>>>>> correctly format the query string and pass to tomcat/solr.
>>>>>> I somehow want to build own request handler in java so I skip the whole
>>>>>> apache/php request that is just for formating.
>>>>>> This will saves me tons of requests to apache since I use solr directly
>>>>>> from javascript.
>>>>>>
>>>>>> Would like to ask if there is something ready that I can use and adjust.
>>>>>> I am kinda new in Java but once I get the pointers
>>>>>> I think should be able to pull out.
>>>>>> Thanks,
>>>>>> JD
>>>>>>
>>>>>>
>>>>>>
>>>>>>
>>>>> -----------------------------------------------------
>>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>>> http://www.opensourceconnections.com
>>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>>>>
>>> -----------------------------------------------------
>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>> http://www.opensourceconnections.com
>>> Free/Busy: http://tinyurl.com/eric-cal
>>>
>>>
>>>
>>>
>>>
>>>
>>
>>
>>
>
>



-- 
-----------------------------------------------------
Noble Paul | Principal Engineer| AOL | http://aol.com

Re: building custom RequestHandlers

Posted by Julian Davchev <jm...@drun.net>.
Is it just me or this is thread steal? nothing todo with what thread is
originally about.
Cheers

Bill Dueber wrote:
> Is it possible to change the javascript  output? I find some of the
> information choices (e.g., that facet information is returned in a flat
> list, with facet names in the even-numbered indexes and number-of-items
> following them in the odd-numbered indexes) kind of annoying.
>
> On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <epugh@opensourceconnections.com
>   
>> wrote:
>>     
>
>   
>> Like most things JavaScript, I found that I had to just dig through it and
>> play with it.  However, the Reuters demo site was very easy to customize to
>> interact with my own Solr instance, and I went from there.
>>
>>
>> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>>
>>  Never used it.. I am just looking in docs how can I extend solr but no
>>     
>>> luck so far :(
>>> Hoping for some docs or real extend example.
>>>
>>>
>>>
>>> Eric Pugh wrote:
>>>
>>>       
>>>> Are you using the JavaScript interface to Solr?
>>>> http://wiki.apache.org/solr/SolrJS
>>>>
>>>> It may provide much of what you are looking for!
>>>>
>>>> Eric
>>>>
>>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>>
>>>>  I am using solr and php quite nicely.
>>>>         
>>>>> Currently the work flow includes some manipulation on php side so I
>>>>> correctly format the query string and pass to tomcat/solr.
>>>>> I somehow want to build own request handler in java so I skip the whole
>>>>> apache/php request that is just for formating.
>>>>> This will saves me tons of requests to apache since I use solr directly
>>>>> from javascript.
>>>>>
>>>>> Would like to ask if there is something ready that I can use and adjust.
>>>>> I am kinda new in Java but once I get the pointers
>>>>> I think should be able to pull out.
>>>>> Thanks,
>>>>> JD
>>>>>
>>>>>
>>>>>
>>>>>           
>>>> -----------------------------------------------------
>>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>>> http://www.opensourceconnections.com
>>>> Free/Busy: http://tinyurl.com/eric-cal
>>>>
>>>>
>>>>
>>>>
>>>>
>>>>         
>> -----------------------------------------------------
>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>> http://www.opensourceconnections.com
>> Free/Busy: http://tinyurl.com/eric-cal
>>
>>
>>
>>
>>
>>     
>
>
>   


Re: building custom RequestHandlers

Posted by Chris Hostetter <ho...@fucit.org>.
: Is it possible to change the javascript  output? I find some of the
: information choices (e.g., that facet information is returned in a flat
: list, with facet names in the even-numbered indexes and number-of-items
: following them in the odd-numbered indexes) kind of annoying.

Did you look at the optional params for the JSON output format? (ie: 
json.nl)...

http://wiki.apache.org/solr/SolJSON




-Hoss


Re: building custom RequestHandlers

Posted by Bill Dueber <bi...@dueber.com>.
Is it possible to change the javascript  output? I find some of the
information choices (e.g., that facet information is returned in a flat
list, with facet names in the even-numbered indexes and number-of-items
following them in the odd-numbered indexes) kind of annoying.

On Tue, Jun 23, 2009 at 12:16 PM, Eric Pugh <epugh@opensourceconnections.com
> wrote:

> Like most things JavaScript, I found that I had to just dig through it and
> play with it.  However, the Reuters demo site was very easy to customize to
> interact with my own Solr instance, and I went from there.
>
>
> On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:
>
>  Never used it.. I am just looking in docs how can I extend solr but no
>> luck so far :(
>> Hoping for some docs or real extend example.
>>
>>
>>
>> Eric Pugh wrote:
>>
>>> Are you using the JavaScript interface to Solr?
>>> http://wiki.apache.org/solr/SolrJS
>>>
>>> It may provide much of what you are looking for!
>>>
>>> Eric
>>>
>>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>>
>>>  I am using solr and php quite nicely.
>>>> Currently the work flow includes some manipulation on php side so I
>>>> correctly format the query string and pass to tomcat/solr.
>>>> I somehow want to build own request handler in java so I skip the whole
>>>> apache/php request that is just for formating.
>>>> This will saves me tons of requests to apache since I use solr directly
>>>> from javascript.
>>>>
>>>> Would like to ask if there is something ready that I can use and adjust.
>>>> I am kinda new in Java but once I get the pointers
>>>> I think should be able to pull out.
>>>> Thanks,
>>>> JD
>>>>
>>>>
>>>>
>>> -----------------------------------------------------
>>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>>> http://www.opensourceconnections.com
>>> Free/Busy: http://tinyurl.com/eric-cal
>>>
>>>
>>>
>>>
>>>
>>
> -----------------------------------------------------
> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> http://www.opensourceconnections.com
> Free/Busy: http://tinyurl.com/eric-cal
>
>
>
>
>


-- 
Bill Dueber
Library Systems Programmer
University of Michigan Library

Re: building custom RequestHandlers

Posted by Eric Pugh <ep...@opensourceconnections.com>.
Like most things JavaScript, I found that I had to just dig through it  
and play with it.  However, the Reuters demo site was very easy to  
customize to interact with my own Solr instance, and I went from there.

On Jun 23, 2009, at 11:30 AM, Julian Davchev wrote:

> Never used it.. I am just looking in docs how can I extend solr but no
> luck so far :(
> Hoping for some docs or real extend example.
>
>
>
> Eric Pugh wrote:
>> Are you using the JavaScript interface to Solr?
>> http://wiki.apache.org/solr/SolrJS
>>
>> It may provide much of what you are looking for!
>>
>> Eric
>>
>> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>>
>>> I am using solr and php quite nicely.
>>> Currently the work flow includes some manipulation on php side so I
>>> correctly format the query string and pass to tomcat/solr.
>>> I somehow want to build own request handler in java so I skip the  
>>> whole
>>> apache/php request that is just for formating.
>>> This will saves me tons of requests to apache since I use solr  
>>> directly
>>> from javascript.
>>>
>>> Would like to ask if there is something ready that I can use and  
>>> adjust.
>>> I am kinda new in Java but once I get the pointers
>>> I think should be able to pull out.
>>> Thanks,
>>> JD
>>>
>>>
>>
>> -----------------------------------------------------
>> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
>> http://www.opensourceconnections.com
>> Free/Busy: http://tinyurl.com/eric-cal
>>
>>
>>
>>
>

-----------------------------------------------------
Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com
Free/Busy: http://tinyurl.com/eric-cal





Re: building custom RequestHandlers

Posted by Julian Davchev <jm...@drun.net>.
Never used it.. I am just looking in docs how can I extend solr but no
luck so far :(
Hoping for some docs or real extend example.



Eric Pugh wrote:
> Are you using the JavaScript interface to Solr? 
> http://wiki.apache.org/solr/SolrJS
>
> It may provide much of what you are looking for!
>
> Eric
>
> On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:
>
>> I am using solr and php quite nicely.
>> Currently the work flow includes some manipulation on php side so I
>> correctly format the query string and pass to tomcat/solr.
>> I somehow want to build own request handler in java so I skip the whole
>> apache/php request that is just for formating.
>> This will saves me tons of requests to apache since I use solr directly
>> from javascript.
>>
>> Would like to ask if there is something ready that I can use and adjust.
>> I am kinda new in Java but once I get the pointers
>> I think should be able to pull out.
>> Thanks,
>> JD
>>
>>
>
> -----------------------------------------------------
> Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 |
> http://www.opensourceconnections.com
> Free/Busy: http://tinyurl.com/eric-cal
>
>
>
>


Re: building custom RequestHandlers

Posted by Eric Pugh <ep...@opensourceconnections.com>.
Are you using the JavaScript interface to Solr?  http://wiki.apache.org/solr/SolrJS

It may provide much of what you are looking for!

Eric

On Jun 23, 2009, at 10:27 AM, Julian Davchev wrote:

> I am using solr and php quite nicely.
> Currently the work flow includes some manipulation on php side so I
> correctly format the query string and pass to tomcat/solr.
> I somehow want to build own request handler in java so I skip the  
> whole
> apache/php request that is just for formating.
> This will saves me tons of requests to apache since I use solr  
> directly
> from javascript.
>
> Would like to ask if there is something ready that I can use and  
> adjust.
> I am kinda new in Java but once I get the pointers
> I think should be able to pull out.
> Thanks,
> JD
>
>

-----------------------------------------------------
Eric Pugh | Principal | OpenSource Connections, LLC | 434.466.1467 | http://www.opensourceconnections.com
Free/Busy: http://tinyurl.com/eric-cal