Re: how to create a custom queryparse to handle new functions

2009-09-11 Thread Chris Hostetter

I think you and Shalin are having a vocabulary problem.

you used the term function which has a specific meaning in Solr, if you 
want to write a new function, which works with the existing Function 
syntax solr provides, and can be nested inside of other functions, then 
what you want to write is a ValueSourceParser.  If you want to write your 
own Query parser with an entirely new syntax (in which you want things to 
look like function calls and produce query objects) then you need to 
implement a QParserPlugin.

Some pointers about both can be found here...

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

:  You do not need to create a custom query parser for this. You just need to
:  create a custom function query. Look at one of the existing function queries
:  in Solr as an example.
: 
: This is where the need originates from -
: 
http://www.lucidimagination.com/search/document/a4bb0dfee53f7493/how_to_scan_dynamic_field_without_specifying_each_field_in_query
: 
: Within the function, the intent is to rewrite incoming parameter into a
: different query. Can this be done? AFAIK, not.
: 
: Cheers
: Avlesh
: 
: On Sat, Sep 5, 2009 at 3:21 AM, Shalin Shekhar Mangar 
: shalinman...@gmail.com wrote:
: 
:  On Sat, Sep 5, 2009 at 2:15 AM, gdeconto gerald.deco...@topproducer.com
:  wrote:
: 
:  
:   Can someone point me in the general direction of how to create a custom
:   queryparser that would allow me to create custom query commands like
:  this:
:  
:   
http://localhost:8994/solr/select?q=myfunction(http://localhost:8994/solr/select?q=myfunction%28
:  http://localhost:8994/solr/select?q=myfunction%28�Foo�,
:   3)
:  
:   or point me towards an example?
:  
:   note that the actual functionality of myfunction is not defined.  I am
:  just
:   wondering if this sort of extensibility is possible.
:  
: 
:  You do not need to create a custom query parser for this. You just need to
:  create a custom function query. Look at one of the existing function
:  queries
:  in Solr as an example.
: 
: 
:  --
:  Regards,
:  Shalin Shekhar Mangar.
: 
: 



-Hoss

Re: how to create a custom queryparse to handle new functions

2009-09-04 Thread Shalin Shekhar Mangar
On Sat, Sep 5, 2009 at 2:15 AM, gdeconto gerald.deco...@topproducer.comwrote:


 Can someone point me in the general direction of how to create a custom
 queryparser that would allow me to create custom query commands like this:

 http://localhost:8994/solr/select?q=myfunction(http://localhost:8994/solr/select?q=myfunction%28‘Foo’,
 3)

 or point me towards an example?

 note that the actual functionality of myfunction is not defined.  I am just
 wondering if this sort of extensibility is possible.


You do not need to create a custom query parser for this. You just need to
create a custom function query. Look at one of the existing function queries
in Solr as an example.


-- 
Regards,
Shalin Shekhar Mangar.


Re: how to create a custom queryparse to handle new functions

2009-09-04 Thread Avlesh Singh

 You do not need to create a custom query parser for this. You just need to
 create a custom function query. Look at one of the existing function queries
 in Solr as an example.

This is where the need originates from -
http://www.lucidimagination.com/search/document/a4bb0dfee53f7493/how_to_scan_dynamic_field_without_specifying_each_field_in_query

Within the function, the intent is to rewrite incoming parameter into a
different query. Can this be done? AFAIK, not.

Cheers
Avlesh

On Sat, Sep 5, 2009 at 3:21 AM, Shalin Shekhar Mangar 
shalinman...@gmail.com wrote:

 On Sat, Sep 5, 2009 at 2:15 AM, gdeconto gerald.deco...@topproducer.com
 wrote:

 
  Can someone point me in the general direction of how to create a custom
  queryparser that would allow me to create custom query commands like
 this:
 
  http://localhost:8994/solr/select?q=myfunction(http://localhost:8994/solr/select?q=myfunction%28
 http://localhost:8994/solr/select?q=myfunction%28‘Foo’,
  3)
 
  or point me towards an example?
 
  note that the actual functionality of myfunction is not defined.  I am
 just
  wondering if this sort of extensibility is possible.
 

 You do not need to create a custom query parser for this. You just need to
 create a custom function query. Look at one of the existing function
 queries
 in Solr as an example.


 --
 Regards,
 Shalin Shekhar Mangar.