You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@nutch.apache.org by Jeet Singh <je...@gmail.com> on 2008/04/20 14:40:44 UTC
Filtering on a field
I've created a field named 's3-type' in every document during indexing.
Now I want to search using this field as a filter.
Basically if I type the query as... laptop s3-type:comp
then I want all those docs to match which have value 'comp' in their
s3-type field.
I created a plugin from copying query-site as replacing field-name
"site" with "s3-type" in super constructor.
I also defined the field name in its plugin file.
But when I search for query... laptop s3-type:comp
I get zero results. Infact my plugin is not even executed when I search
(Plugin is included in nutch-site.xml)
Is this hyphen in the field name that's causing problem?
I'm using following statement in my IndexingFilter plugin:
doc.add(new Field("s3-type", "comp", Field.Store.YES,
Field.Index.TOKENIZED));
Please help
Jeet Singh
Re: Filtering on a field
Posted by Jasper Kamperman <ja...@openwaternet.com>.
Just IndexingFilter is not enough, you also need a QueryFilter. See
http://wiki.apache.org/nutch/WritingPluginExample-0.9 for a complete
example.
Jasper
On Apr 20, 2008, at 5:40 AM, Jeet Singh wrote:
> I've created a field named 's3-type' in every document during
> indexing. Now I want to search using this field as a filter.
>
> Basically if I type the query as... laptop s3-type:comp
> then I want all those docs to match which have value 'comp' in
> their s3-type field.
>
> I created a plugin from copying query-site as replacing field-name
> "site" with "s3-type" in super constructor.
> I also defined the field name in its plugin file.
>
> But when I search for query... laptop s3-type:comp
> I get zero results. Infact my plugin is not even executed when I
> search (Plugin is included in nutch-site.xml)
>
> Is this hyphen in the field name that's causing problem?
> I'm using following statement in my IndexingFilter plugin:
>
> doc.add(new Field("s3-type", "comp", Field.Store.YES,
> Field.Index.TOKENIZED));
>
>
> Please help
> Jeet Singh
>