You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Cool The Breezer <te...@yahoo.com> on 2009/01/09 11:22:41 UTC

Search on custom field

Hi,
   I am trying to search on custom field which I have already added using custom plugins. There were some discussions on this topic earlier and as per that I added  a new QueryFilter, called Availability and following is the plugin.xml structure

<extension id="org.apache.nutch.searcher.classitrend.query.Availability"
              name="Nutch Availability Query Filter"
              point="org.apache.nutch.searcher.QueryFilter">
      <implementation id="availability"
                      class="org.apache.nutch.searcher.classitrend.query.Availability">
        <parameter name="fields" value="availability"/>
      </implementation>
      
   </extension>

But still when I am searching using range query like availability:{0 TO 10000}, it return nothing.
I debugged the code and found that the actual query generated does not use "availability" as a field rather it used availability as a value for all default fields.
I am struggling to solve this from one day. Appreciate your help on this.

regards,
RB



      

Re: Search on custom field

Posted by Cool The Breezer <te...@yahoo.com>.
The format of range query was wrong. It should be availability:0-10000. Still got another problem. I am sure somebody already faced this problem. Any pointer wuld be enough solve this issue

java.lang.ClassCastException: org.apache.nutch.searcher.Query$Phrase
	at org.apache.nutch.searcher.Query$Clause.getTerm(Query.java:97)
	at org.apache.nutch.searcher.RawFieldQueryFilter.filter(RawFieldQueryFilter.java:74)
	at org.apache.nutch.searcher.QueryFilters.filter(QueryFilters.java:109)
	at org.apache.nutch.searcher.IndexSearcher.search(IndexSearcher.java:94)
	at org.apache.nutch.searcher.NutchBean.search(NutchBean.java:189)
	at org.apache.nutch.searcher.NutchBean.search(NutchBean.java:182)


--- On Fri, 1/9/09, Cool The Breezer <te...@yahoo.com> wrote:

> From: Cool The Breezer <te...@yahoo.com>
> Subject: Search on custom field
> To: nutch-user@lucene.apache.org
> Date: Friday, January 9, 2009, 5:22 AM
> Hi,
>    I am trying to search on custom field which I have
> already added using custom plugins. There were some
> discussions on this topic earlier and as per that I added  a
> new QueryFilter, called Availability and following is the
> plugin.xml structure
> 
> <extension
> id="org.apache.nutch.searcher.classitrend.query.Availability"
>               name="Nutch Availability Query
> Filter"
>              
> point="org.apache.nutch.searcher.QueryFilter">
>       <implementation id="availability"
>                      
> class="org.apache.nutch.searcher.classitrend.query.Availability">
>         <parameter name="fields"
> value="availability"/>
>       </implementation>
>       
>    </extension>
> 
> But still when I am searching using range query like
> availability:{0 TO 10000}, it return nothing.
> I debugged the code and found that the actual query
> generated does not use "availability" as a field
> rather it used availability as a value for all default
> fields.
> I am struggling to solve this from one day. Appreciate your
> help on this.
> 
> regards,
> RB