Newbie needs help with fielded searching and sorting on custom fields

classic Classic list List threaded Threaded
12 messages Options
Reply | Threaded
Open this post in threaded view
|

Newbie needs help with fielded searching and sorting on custom fields

Jayant Kumar Gandhi
Hi All,

I am planning/evaluating Nutch for my website. I will be have a page
with 3-4 custom metafields (field1, field2,...) with their values. I
need to be able to search using the field tag like field1:<search
term> field2:<seach term> etc. Also the will be shown 3-4 links using
which he can sort the results based on any of these custom fields.
I have been searching the net but I have not been able to find a
tutorial/how-to regarding this. I think the book 'Lucene in Action'
covers it, but I am not very sure about it. Also, I have not been able
to find it locally.

Can someone please guide me with this?

Thanks and Best Regards,
Jayant Gandhi.

--
www.jkg.in | http://www.jkg.in/contact-me/
Jayant Kr. Gandhi
Student,
M.Tech. Computer Tech. Class of 2007,
IIT Delhi, India
Reply | Threaded
Open this post in threaded view
|

Compiling Nutch

Honda-Search Administrator
I normally work in PHP which doesn't require compilation.  I have made a few
changes to the Nutch Source code and need to know how to compile is so that
it takes effect when running Nutch.  Can anyone help?

Just a basic walkthrough would be appreciated.

Matt

Reply | Threaded
Open this post in threaded view
|

Re: Compiling Nutch

Thomas Delnoij-3
You will first have to install Apache Ant (http://ant.apache.org/).

Calling 'ant' in the top level Nutch directory will compile the code.

Calling 'ant tar' will create a distribution tar.

Other targets for testing can be viewed in the build.xml file.

Rgrds,. Thomas



On 6/19/06, Honda-Search Administrator <[hidden email]> wrote:
> I normally work in PHP which doesn't require compilation.  I have made a few
> changes to the Nutch Source code and need to know how to compile is so that
> it takes effect when running Nutch.  Can anyone help?
>
> Just a basic walkthrough would be appreciated.
>
> Matt
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Thomas Delnoij-3
In reply to this post by Jayant Kumar Gandhi
You can start here for learning more about Nutch:

http://wiki.apache.org/nutch/

And here is an excellent tutorial that covers getting your custom
fields in the index:

http://wiki.apache.org/nutch/WritingPluginExample

If you have read all this you can come back and we will discuss sorting :)

HTH Thomas

On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:

> Hi All,
>
> I am planning/evaluating Nutch for my website. I will be have a page
> with 3-4 custom metafields (field1, field2,...) with their values. I
> need to be able to search using the field tag like field1:<search
> term> field2:<seach term> etc. Also the will be shown 3-4 links using
> which he can sort the results based on any of these custom fields.
> I have been searching the net but I have not been able to find a
> tutorial/how-to regarding this. I think the book 'Lucene in Action'
> covers it, but I am not very sure about it. Also, I have not been able
> to find it locally.
>
> Can someone please guide me with this?
>
> Thanks and Best Regards,
> Jayant Gandhi.
>
> --
> www.jkg.in | http://www.jkg.in/contact-me/
> Jayant Kr. Gandhi
> Student,
> M.Tech. Computer Tech. Class of 2007,
> IIT Delhi, India
>
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Jayant Kumar Gandhi
Hi thanks!!!

I have done all that. I was able to achieve sorting as well. I have
issue in fielded searching. The search for the custom field is not
working.
If I search for 'rating:4' i get no results, but in normal search
results if i click explain, i am able to see records having rating 4
exist. the indexing/parsing is happening fine. plugin has been
activated in nutch-site.xml . still i get no search results. any idea
why?

On 6/23/06, TDLN <[hidden email]> wrote:

> You can start here for learning more about Nutch:
>
> http://wiki.apache.org/nutch/
>
> And here is an excellent tutorial that covers getting your custom
> fields in the index:
>
> http://wiki.apache.org/nutch/WritingPluginExample
>
> If you have read all this you can come back and we will discuss sorting :)
>
> HTH Thomas
>
> On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > Hi All,
> >
> > I am planning/evaluating Nutch for my website. I will be have a page
> > with 3-4 custom metafields (field1, field2,...) with their values. I
> > need to be able to search using the field tag like field1:<search
> > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > which he can sort the results based on any of these custom fields.
> > I have been searching the net but I have not been able to find a
> > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > covers it, but I am not very sure about it. Also, I have not been able
> > to find it locally.
> >
> > Can someone please guide me with this?
> >
> > Thanks and Best Regards,
> > Jayant Gandhi.
> >
> > --
> > www.jkg.in | http://www.jkg.in/contact-me/
> > Jayant Kr. Gandhi
> > Student,
> > M.Tech. Computer Tech. Class of 2007,
> > IIT Delhi, India
> >
>


--
www.jkg.in | http://www.jkg.in/contact-me/
Jayant Kr. Gandhi | +91-9871412929
M.Tech. Computer Tech. Class of 2007,
D-38, Aravali Hostel, IIT Delhi,
Hauz Khas, Delhi-110016
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Thomas Delnoij-3
Please post plugin.xml and QueryFilter implementation code.

Rgrds, Thomas

On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:

> Hi thanks!!!
>
> I have done all that. I was able to achieve sorting as well. I have
> issue in fielded searching. The search for the custom field is not
> working.
> If I search for 'rating:4' i get no results, but in normal search
> results if i click explain, i am able to see records having rating 4
> exist. the indexing/parsing is happening fine. plugin has been
> activated in nutch-site.xml . still i get no search results. any idea
> why?
>
> On 6/23/06, TDLN <[hidden email]> wrote:
> > You can start here for learning more about Nutch:
> >
> > http://wiki.apache.org/nutch/
> >
> > And here is an excellent tutorial that covers getting your custom
> > fields in the index:
> >
> > http://wiki.apache.org/nutch/WritingPluginExample
> >
> > If you have read all this you can come back and we will discuss sorting :)
> >
> > HTH Thomas
> >
> > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > Hi All,
> > >
> > > I am planning/evaluating Nutch for my website. I will be have a page
> > > with 3-4 custom metafields (field1, field2,...) with their values. I
> > > need to be able to search using the field tag like field1:<search
> > > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > > which he can sort the results based on any of these custom fields.
> > > I have been searching the net but I have not been able to find a
> > > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > > covers it, but I am not very sure about it. Also, I have not been able
> > > to find it locally.
> > >
> > > Can someone please guide me with this?
> > >
> > > Thanks and Best Regards,
> > > Jayant Gandhi.
> > >
> > > --
> > > www.jkg.in | http://www.jkg.in/contact-me/
> > > Jayant Kr. Gandhi
> > > Student,
> > > M.Tech. Computer Tech. Class of 2007,
> > > IIT Delhi, India
> > >
> >
>
>
> --
> www.jkg.in | http://www.jkg.in/contact-me/
> Jayant Kr. Gandhi | +91-9871412929
> M.Tech. Computer Tech. Class of 2007,
> D-38, Aravali Hostel, IIT Delhi,
> Hauz Khas, Delhi-110016
>
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Jayant Kumar Gandhi
I also tried with

field="rating" instead of fields="DEFAULT" in plugin.xml, still no luck

On 6/24/06, TDLN <[hidden email]> wrote:

> Please post plugin.xml and QueryFilter implementation code.
>
> Rgrds, Thomas
>
> On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > Hi thanks!!!
> >
> > I have done all that. I was able to achieve sorting as well. I have
> > issue in fielded searching. The search for the custom field is not
> > working.
> > If I search for 'rating:4' i get no results, but in normal search
> > results if i click explain, i am able to see records having rating 4
> > exist. the indexing/parsing is happening fine. plugin has been
> > activated in nutch-site.xml . still i get no search results. any idea
> > why?
> >
> > On 6/23/06, TDLN <[hidden email]> wrote:
> > > You can start here for learning more about Nutch:
> > >
> > > http://wiki.apache.org/nutch/
> > >
> > > And here is an excellent tutorial that covers getting your custom
> > > fields in the index:
> > >
> > > http://wiki.apache.org/nutch/WritingPluginExample
> > >
> > > If you have read all this you can come back and we will discuss sorting :)
> > >
> > > HTH Thomas
> > >
> > > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > Hi All,
> > > >
> > > > I am planning/evaluating Nutch for my website. I will be have a page
> > > > with 3-4 custom metafields (field1, field2,...) with their values. I
> > > > need to be able to search using the field tag like field1:<search
> > > > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > > > which he can sort the results based on any of these custom fields.
> > > > I have been searching the net but I have not been able to find a
> > > > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > > > covers it, but I am not very sure about it. Also, I have not been able
> > > > to find it locally.
> > > >
> > > > Can someone please guide me with this?
> > > >
> > > > Thanks and Best Regards,
> > > > Jayant Gandhi.
> > > >
> > > > --
> > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > Jayant Kr. Gandhi
> > > > Student,
> > > > M.Tech. Computer Tech. Class of 2007,
> > > > IIT Delhi, India
> > > >
> > >
> >
> >
> > --
> > www.jkg.in | http://www.jkg.in/contact-me/
> > Jayant Kr. Gandhi | +91-9871412929
> > M.Tech. Computer Tech. Class of 2007,
> > D-38, Aravali Hostel, IIT Delhi,
> > Hauz Khas, Delhi-110016
> >
>

--
www.jkg.in | http://www.jkg.in/contact-me/
Jayant Kr. Gandhi | +91-9871412929
M.Tech. Computer Tech. Class of 2007,
D-38, Aravali Hostel, IIT Delhi,
Hauz Khas, Delhi-110016

plugin.xml (2K) Download Attachment
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Thomas Delnoij-3
This is 0.7.2 right?

The QueryFilter implementation code didn't make it through.

Rgrds, Thomas

On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:

> I also tried with
>
> field="rating" instead of fields="DEFAULT" in plugin.xml, still no luck
>
> On 6/24/06, TDLN <[hidden email]> wrote:
> > Please post plugin.xml and QueryFilter implementation code.
> >
> > Rgrds, Thomas
> >
> > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > Hi thanks!!!
> > >
> > > I have done all that. I was able to achieve sorting as well. I have
> > > issue in fielded searching. The search for the custom field is not
> > > working.
> > > If I search for 'rating:4' i get no results, but in normal search
> > > results if i click explain, i am able to see records having rating 4
> > > exist. the indexing/parsing is happening fine. plugin has been
> > > activated in nutch-site.xml . still i get no search results. any idea
> > > why?
> > >
> > > On 6/23/06, TDLN <[hidden email]> wrote:
> > > > You can start here for learning more about Nutch:
> > > >
> > > > http://wiki.apache.org/nutch/
> > > >
> > > > And here is an excellent tutorial that covers getting your custom
> > > > fields in the index:
> > > >
> > > > http://wiki.apache.org/nutch/WritingPluginExample
> > > >
> > > > If you have read all this you can come back and we will discuss sorting :)
> > > >
> > > > HTH Thomas
> > > >
> > > > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > > Hi All,
> > > > >
> > > > > I am planning/evaluating Nutch for my website. I will be have a page
> > > > > with 3-4 custom metafields (field1, field2,...) with their values. I
> > > > > need to be able to search using the field tag like field1:<search
> > > > > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > > > > which he can sort the results based on any of these custom fields.
> > > > > I have been searching the net but I have not been able to find a
> > > > > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > > > > covers it, but I am not very sure about it. Also, I have not been able
> > > > > to find it locally.
> > > > >
> > > > > Can someone please guide me with this?
> > > > >
> > > > > Thanks and Best Regards,
> > > > > Jayant Gandhi.
> > > > >
> > > > > --
> > > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > > Jayant Kr. Gandhi
> > > > > Student,
> > > > > M.Tech. Computer Tech. Class of 2007,
> > > > > IIT Delhi, India
> > > > >
> > > >
> > >
> > >
> > > --
> > > www.jkg.in | http://www.jkg.in/contact-me/
> > > Jayant Kr. Gandhi | +91-9871412929
> > > M.Tech. Computer Tech. Class of 2007,
> > > D-38, Aravali Hostel, IIT Delhi,
> > > Hauz Khas, Delhi-110016
> > >
> >
>
>
> --
> www.jkg.in | http://www.jkg.in/contact-me/
> Jayant Kr. Gandhi | +91-9871412929
> M.Tech. Computer Tech. Class of 2007,
> D-38, Aravali Hostel, IIT Delhi,
> Hauz Khas, Delhi-110016
>
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Jayant Kumar Gandhi
ah yeah 0.7.2.. sorry forgot to mention that.. my bad...

i am pasting the code and attaching it again as well:-

package org.apache.nutch.parse.rating;
import org.apache.nutch.searcher.FieldQueryFilter;
import java.util.logging.Logger;
import org.apache.nutch.util.LogFormatter;

public class RatingQueryFilter extends FieldQueryFilter {
        private static final Logger LOG = LogFormatter
    .getLogger(RatingParser.class.getName());
  public RatingQueryFilter() {
    super("rating", 5f);
        LOG.info("Added a rating query");
  }
}



On 6/24/06, TDLN <[hidden email]> wrote:

> This is 0.7.2 right?
>
> The QueryFilter implementation code didn't make it through.
>
> Rgrds, Thomas
>
> On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > I also tried with
> >
> > field="rating" instead of fields="DEFAULT" in plugin.xml, still no luck
> >
> > On 6/24/06, TDLN <[hidden email]> wrote:
> > > Please post plugin.xml and QueryFilter implementation code.
> > >
> > > Rgrds, Thomas
> > >
> > > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > Hi thanks!!!
> > > >
> > > > I have done all that. I was able to achieve sorting as well. I have
> > > > issue in fielded searching. The search for the custom field is not
> > > > working.
> > > > If I search for 'rating:4' i get no results, but in normal search
> > > > results if i click explain, i am able to see records having rating 4
> > > > exist. the indexing/parsing is happening fine. plugin has been
> > > > activated in nutch-site.xml . still i get no search results. any idea
> > > > why?
> > > >
> > > > On 6/23/06, TDLN <[hidden email]> wrote:
> > > > > You can start here for learning more about Nutch:
> > > > >
> > > > > http://wiki.apache.org/nutch/
> > > > >
> > > > > And here is an excellent tutorial that covers getting your custom
> > > > > fields in the index:
> > > > >
> > > > > http://wiki.apache.org/nutch/WritingPluginExample
> > > > >
> > > > > If you have read all this you can come back and we will discuss sorting :)
> > > > >
> > > > > HTH Thomas
> > > > >
> > > > > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > > > Hi All,
> > > > > >
> > > > > > I am planning/evaluating Nutch for my website. I will be have a page
> > > > > > with 3-4 custom metafields (field1, field2,...) with their values. I
> > > > > > need to be able to search using the field tag like field1:<search
> > > > > > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > > > > > which he can sort the results based on any of these custom fields.
> > > > > > I have been searching the net but I have not been able to find a
> > > > > > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > > > > > covers it, but I am not very sure about it. Also, I have not been able
> > > > > > to find it locally.
> > > > > >
> > > > > > Can someone please guide me with this?
> > > > > >
> > > > > > Thanks and Best Regards,
> > > > > > Jayant Gandhi.
> > > > > >
> > > > > > --
> > > > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > > > Jayant Kr. Gandhi
> > > > > > Student,
> > > > > > M.Tech. Computer Tech. Class of 2007,
> > > > > > IIT Delhi, India
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > Jayant Kr. Gandhi | +91-9871412929
> > > > M.Tech. Computer Tech. Class of 2007,
> > > > D-38, Aravali Hostel, IIT Delhi,
> > > > Hauz Khas, Delhi-110016
> > > >
> > >
> >
> >
> > --
> > www.jkg.in | http://www.jkg.in/contact-me/
> > Jayant Kr. Gandhi | +91-9871412929
> > M.Tech. Computer Tech. Class of 2007,
> > D-38, Aravali Hostel, IIT Delhi,
> > Hauz Khas, Delhi-110016
> >
> >
> >
>

--
www.jkg.in | http://www.jkg.in/contact-me/
Jayant Kr. Gandhi | +91-9871412929
M.Tech. Computer Tech. Class of 2007,
D-38, Aravali Hostel, IIT Delhi,
Hauz Khas, Delhi-110016
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Thomas Delnoij-3
Ok, Jayant, thanks.

I can only give you some tips that you might want to try out.
Sometimes the problem you describe was caused by not boosting the
field. This does not apply to your case as you are calling
super("rating", 5f);

I am comparing your code to my code (that is working fine) to see
where the differences are. The only thing I see is that I am extending
RawFieldQueryFilter and not FieldQueryFilter. At the same time my
plugin.xml has fields="field_name" and not fields="DEFAULT".

I do not know the theory behind the difference between a
RawFieldQueryFilter and FieldQueryFilter, but you might want to try
changing those two items.

Let us know the result.

-- Thomas





On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:

> ah yeah 0.7.2.. sorry forgot to mention that.. my bad...
>
> i am pasting the code and attaching it again as well:-
>
> package org.apache.nutch.parse.rating;
> import org.apache.nutch.searcher.FieldQueryFilter;
> import java.util.logging.Logger;
> import org.apache.nutch.util.LogFormatter;
>
> public class RatingQueryFilter extends FieldQueryFilter {
>         private static final Logger LOG = LogFormatter
>     .getLogger(RatingParser.class.getName());
>   public RatingQueryFilter() {
>     super("rating", 5f);
>         LOG.info("Added a rating query");
>   }
> }
>
>
>
> On 6/24/06, TDLN <[hidden email]> wrote:
> > This is 0.7.2 right?
> >
> > The QueryFilter implementation code didn't make it through.
> >
> > Rgrds, Thomas
> >
> > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > I also tried with
> > >
> > > field="rating" instead of fields="DEFAULT" in plugin.xml, still no luck
> > >
> > > On 6/24/06, TDLN <[hidden email]> wrote:
> > > > Please post plugin.xml and QueryFilter implementation code.
> > > >
> > > > Rgrds, Thomas
> > > >
> > > > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > > Hi thanks!!!
> > > > >
> > > > > I have done all that. I was able to achieve sorting as well. I have
> > > > > issue in fielded searching. The search for the custom field is not
> > > > > working.
> > > > > If I search for 'rating:4' i get no results, but in normal search
> > > > > results if i click explain, i am able to see records having rating 4
> > > > > exist. the indexing/parsing is happening fine. plugin has been
> > > > > activated in nutch-site.xml . still i get no search results. any idea
> > > > > why?
> > > > >
> > > > > On 6/23/06, TDLN <[hidden email]> wrote:
> > > > > > You can start here for learning more about Nutch:
> > > > > >
> > > > > > http://wiki.apache.org/nutch/
> > > > > >
> > > > > > And here is an excellent tutorial that covers getting your custom
> > > > > > fields in the index:
> > > > > >
> > > > > > http://wiki.apache.org/nutch/WritingPluginExample
> > > > > >
> > > > > > If you have read all this you can come back and we will discuss sorting :)
> > > > > >
> > > > > > HTH Thomas
> > > > > >
> > > > > > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > > > > Hi All,
> > > > > > >
> > > > > > > I am planning/evaluating Nutch for my website. I will be have a page
> > > > > > > with 3-4 custom metafields (field1, field2,...) with their values. I
> > > > > > > need to be able to search using the field tag like field1:<search
> > > > > > > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > > > > > > which he can sort the results based on any of these custom fields.
> > > > > > > I have been searching the net but I have not been able to find a
> > > > > > > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > > > > > > covers it, but I am not very sure about it. Also, I have not been able
> > > > > > > to find it locally.
> > > > > > >
> > > > > > > Can someone please guide me with this?
> > > > > > >
> > > > > > > Thanks and Best Regards,
> > > > > > > Jayant Gandhi.
> > > > > > >
> > > > > > > --
> > > > > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > > > > Jayant Kr. Gandhi
> > > > > > > Student,
> > > > > > > M.Tech. Computer Tech. Class of 2007,
> > > > > > > IIT Delhi, India
> > > > > > >
> > > > > >
> > > > >
> > > > >
> > > > > --
> > > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > > Jayant Kr. Gandhi | +91-9871412929
> > > > > M.Tech. Computer Tech. Class of 2007,
> > > > > D-38, Aravali Hostel, IIT Delhi,
> > > > > Hauz Khas, Delhi-110016
> > > > >
> > > >
> > >
> > >
> > > --
> > > www.jkg.in | http://www.jkg.in/contact-me/
> > > Jayant Kr. Gandhi | +91-9871412929
> > > M.Tech. Computer Tech. Class of 2007,
> > > D-38, Aravali Hostel, IIT Delhi,
> > > Hauz Khas, Delhi-110016
> > >
> > >
> > >
> >
>
>
> --
> www.jkg.in | http://www.jkg.in/contact-me/
> Jayant Kr. Gandhi | +91-9871412929
> M.Tech. Computer Tech. Class of 2007,
> D-38, Aravali Hostel, IIT Delhi,
> Hauz Khas, Delhi-110016
>
>
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

Jayant Kumar Gandhi
Thanks. It worked. I started to wonder why it didn't work with
FieldQueryFilter. I realized I had copied the wrong WAR file then. In
a hurry I picked up the war file from the root nutch directory instead
of the build directory.
Lesson learnt: Don't do things at 4am. Get some sleep :)

Cheers,
Jayant

On 6/24/06, TDLN <[hidden email]> wrote:

> Ok, Jayant, thanks.
>
> I can only give you some tips that you might want to try out.
> Sometimes the problem you describe was caused by not boosting the
> field. This does not apply to your case as you are calling
> super("rating", 5f);
>
> I am comparing your code to my code (that is working fine) to see
> where the differences are. The only thing I see is that I am extending
> RawFieldQueryFilter and not FieldQueryFilter. At the same time my
> plugin.xml has fields="field_name" and not fields="DEFAULT".
>
> I do not know the theory behind the difference between a
> RawFieldQueryFilter and FieldQueryFilter, but you might want to try
> changing those two items.
>
> Let us know the result.
>
> -- Thomas
>
>
>
>
>
> On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > ah yeah 0.7.2.. sorry forgot to mention that.. my bad...
> >
> > i am pasting the code and attaching it again as well:-
> >
> > package org.apache.nutch.parse.rating;
> > import org.apache.nutch.searcher.FieldQueryFilter;
> > import java.util.logging.Logger;
> > import org.apache.nutch.util.LogFormatter;
> >
> > public class RatingQueryFilter extends FieldQueryFilter {
> >         private static final Logger LOG = LogFormatter
> >     .getLogger(RatingParser.class.getName());
> >   public RatingQueryFilter() {
> >     super("rating", 5f);
> >         LOG.info("Added a rating query");
> >   }
> > }
> >
> >
> >
> > On 6/24/06, TDLN <[hidden email]> wrote:
> > > This is 0.7.2 right?
> > >
> > > The QueryFilter implementation code didn't make it through.
> > >
> > > Rgrds, Thomas
> > >
> > > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > I also tried with
> > > >
> > > > field="rating" instead of fields="DEFAULT" in plugin.xml, still no luck
> > > >
> > > > On 6/24/06, TDLN <[hidden email]> wrote:
> > > > > Please post plugin.xml and QueryFilter implementation code.
> > > > >
> > > > > Rgrds, Thomas
> > > > >
> > > > > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > > > Hi thanks!!!
> > > > > >
> > > > > > I have done all that. I was able to achieve sorting as well. I have
> > > > > > issue in fielded searching. The search for the custom field is not
> > > > > > working.
> > > > > > If I search for 'rating:4' i get no results, but in normal search
> > > > > > results if i click explain, i am able to see records having rating 4
> > > > > > exist. the indexing/parsing is happening fine. plugin has been
> > > > > > activated in nutch-site.xml . still i get no search results. any idea
> > > > > > why?
> > > > > >
> > > > > > On 6/23/06, TDLN <[hidden email]> wrote:
> > > > > > > You can start here for learning more about Nutch:
> > > > > > >
> > > > > > > http://wiki.apache.org/nutch/
> > > > > > >
> > > > > > > And here is an excellent tutorial that covers getting your custom
> > > > > > > fields in the index:
> > > > > > >
> > > > > > > http://wiki.apache.org/nutch/WritingPluginExample
> > > > > > >
> > > > > > > If you have read all this you can come back and we will discuss sorting :)
> > > > > > >
> > > > > > > HTH Thomas
> > > > > > >
> > > > > > > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
> > > > > > > > Hi All,
> > > > > > > >
> > > > > > > > I am planning/evaluating Nutch for my website. I will be have a page
> > > > > > > > with 3-4 custom metafields (field1, field2,...) with their values. I
> > > > > > > > need to be able to search using the field tag like field1:<search
> > > > > > > > term> field2:<seach term> etc. Also the will be shown 3-4 links using
> > > > > > > > which he can sort the results based on any of these custom fields.
> > > > > > > > I have been searching the net but I have not been able to find a
> > > > > > > > tutorial/how-to regarding this. I think the book 'Lucene in Action'
> > > > > > > > covers it, but I am not very sure about it. Also, I have not been able
> > > > > > > > to find it locally.
> > > > > > > >
> > > > > > > > Can someone please guide me with this?
> > > > > > > >
> > > > > > > > Thanks and Best Regards,
> > > > > > > > Jayant Gandhi.
> > > > > > > >
> > > > > > > > --
> > > > > > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > > > > > Jayant Kr. Gandhi
> > > > > > > > Student,
> > > > > > > > M.Tech. Computer Tech. Class of 2007,
> > > > > > > > IIT Delhi, India
> > > > > > > >
> > > > > > >
> > > > > >
> > > > > >
> > > > > > --
> > > > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > > > Jayant Kr. Gandhi | +91-9871412929
> > > > > > M.Tech. Computer Tech. Class of 2007,
> > > > > > D-38, Aravali Hostel, IIT Delhi,
> > > > > > Hauz Khas, Delhi-110016
> > > > > >
> > > > >
> > > >
> > > >
> > > > --
> > > > www.jkg.in | http://www.jkg.in/contact-me/
> > > > Jayant Kr. Gandhi | +91-9871412929
> > > > M.Tech. Computer Tech. Class of 2007,
> > > > D-38, Aravali Hostel, IIT Delhi,
> > > > Hauz Khas, Delhi-110016
> > > >
> > > >
> > > >
> > >
> >
> >
> > --
> > www.jkg.in | http://www.jkg.in/contact-me/
> > Jayant Kr. Gandhi | +91-9871412929
> > M.Tech. Computer Tech. Class of 2007,
> > D-38, Aravali Hostel, IIT Delhi,
> > Hauz Khas, Delhi-110016
> >
> >
>


--
www.jkg.in | http://www.jkg.in/contact-me/
Jayant Kr. Gandhi | +91-9871412929
M.Tech. Computer Tech. Class of 2007,
D-38, Aravali Hostel, IIT Delhi,
Hauz Khas, Delhi-110016
Reply | Threaded
Open this post in threaded view
|

Re: Newbie needs help with fielded searching and sorting on custom fields

schackenberg@termindoc.de
Jayant Kumar Gandhi schrieb:
> Thanks. It worked. I started to wonder why it didn't work with
> FieldQueryFilter. I realized I had copied the wrong WAR file then. In
> a hurry I picked up the war file from the root nutch directory instead
> of the build directory.
> Lesson learnt: Don't do things at 4am. Get some sleep :)

yes you are right, where are come from?

>
> Cheers,
> Jayant
>
> On 6/24/06, TDLN <[hidden email]> wrote:
>> Ok, Jayant, thanks.
>>
>> I can only give you some tips that you might want to try out.
>> Sometimes the problem you describe was caused by not boosting the
>> field. This does not apply to your case as you are calling
>> super("rating", 5f);
>>
>> I am comparing your code to my code (that is working fine) to see
>> where the differences are. The only thing I see is that I am extending
>> RawFieldQueryFilter and not FieldQueryFilter. At the same time my
>> plugin.xml has fields="field_name" and not fields="DEFAULT".
>>
>> I do not know the theory behind the difference between a
>> RawFieldQueryFilter and FieldQueryFilter, but you might want to try
>> changing those two items.
>>
>> Let us know the result.
>>
>> -- Thomas
>>
>>
>>
>>
>>
>> On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
>> > ah yeah 0.7.2.. sorry forgot to mention that.. my bad...
>> >
>> > i am pasting the code and attaching it again as well:-
>> >
>> > package org.apache.nutch.parse.rating;
>> > import org.apache.nutch.searcher.FieldQueryFilter;
>> > import java.util.logging.Logger;
>> > import org.apache.nutch.util.LogFormatter;
>> >
>> > public class RatingQueryFilter extends FieldQueryFilter {
>> >         private static final Logger LOG = LogFormatter
>> >     .getLogger(RatingParser.class.getName());
>> >   public RatingQueryFilter() {
>> >     super("rating", 5f);
>> >         LOG.info("Added a rating query");
>> >   }
>> > }
>> >
>> >
>> >
>> > On 6/24/06, TDLN <[hidden email]> wrote:
>> > > This is 0.7.2 right?
>> > >
>> > > The QueryFilter implementation code didn't make it through.
>> > >
>> > > Rgrds, Thomas
>> > >
>> > > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
>> > > > I also tried with
>> > > >
>> > > > field="rating" instead of fields="DEFAULT" in plugin.xml, still
>> no luck
>> > > >
>> > > > On 6/24/06, TDLN <[hidden email]> wrote:
>> > > > > Please post plugin.xml and QueryFilter implementation code.
>> > > > >
>> > > > > Rgrds, Thomas
>> > > > >
>> > > > > On 6/23/06, Jayant Kumar Gandhi <[hidden email]> wrote:
>> > > > > > Hi thanks!!!
>> > > > > >
>> > > > > > I have done all that. I was able to achieve sorting as well.
>> I have
>> > > > > > issue in fielded searching. The search for the custom field
>> is not
>> > > > > > working.
>> > > > > > If I search for 'rating:4' i get no results, but in normal
>> search
>> > > > > > results if i click explain, i am able to see records having
>> rating 4
>> > > > > > exist. the indexing/parsing is happening fine. plugin has been
>> > > > > > activated in nutch-site.xml . still i get no search results.
>> any idea
>> > > > > > why?
>> > > > > >
>> > > > > > On 6/23/06, TDLN <[hidden email]> wrote:
>> > > > > > > You can start here for learning more about Nutch:
>> > > > > > >
>> > > > > > > http://wiki.apache.org/nutch/
>> > > > > > >
>> > > > > > > And here is an excellent tutorial that covers getting your
>> custom
>> > > > > > > fields in the index:
>> > > > > > >
>> > > > > > > http://wiki.apache.org/nutch/WritingPluginExample
>> > > > > > >
>> > > > > > > If you have read all this you can come back and we will
>> discuss sorting :)
>> > > > > > >
>> > > > > > > HTH Thomas
>> > > > > > >
>> > > > > > > On 6/19/06, Jayant Kumar Gandhi <[hidden email]> wrote:
>> > > > > > > > Hi All,
>> > > > > > > >
>> > > > > > > > I am planning/evaluating Nutch for my website. I will be
>> have a page
>> > > > > > > > with 3-4 custom metafields (field1, field2,...) with
>> their values. I
>> > > > > > > > need to be able to search using the field tag like
>> field1:<search
>> > > > > > > > term> field2:<seach term> etc. Also the will be shown
>> 3-4 links using
>> > > > > > > > which he can sort the results based on any of these
>> custom fields.
>> > > > > > > > I have been searching the net but I have not been able
>> to find a
>> > > > > > > > tutorial/how-to regarding this. I think the book 'Lucene
>> in Action'
>> > > > > > > > covers it, but I am not very sure about it. Also, I have
>> not been able
>> > > > > > > > to find it locally.
>> > > > > > > >
>> > > > > > > > Can someone please guide me with this?
>> > > > > > > >
>> > > > > > > > Thanks and Best Regards,
>> > > > > > > > Jayant Gandhi.
>> > > > > > > >
>> > > > > > > > --
>> > > > > > > > www.jkg.in | http://www.jkg.in/contact-me/
>> > > > > > > > Jayant Kr. Gandhi
>> > > > > > > > Student,
>> > > > > > > > M.Tech. Computer Tech. Class of 2007,
>> > > > > > > > IIT Delhi, India
>> > > > > > > >
>> > > > > > >
>> > > > > >
>> > > > > >
>> > > > > > --
>> > > > > > www.jkg.in | http://www.jkg.in/contact-me/
>> > > > > > Jayant Kr. Gandhi | +91-9871412929
>> > > > > > M.Tech. Computer Tech. Class of 2007,
>> > > > > > D-38, Aravali Hostel, IIT Delhi,
>> > > > > > Hauz Khas, Delhi-110016
>> > > > > >
>> > > > >
>> > > >
>> > > >
>> > > > --
>> > > > www.jkg.in | http://www.jkg.in/contact-me/
>> > > > Jayant Kr. Gandhi | +91-9871412929
>> > > > M.Tech. Computer Tech. Class of 2007,
>> > > > D-38, Aravali Hostel, IIT Delhi,
>> > > > Hauz Khas, Delhi-110016
>> > > >
>> > > >
>> > > >
>> > >
>> >
>> >
>> > --
>> > www.jkg.in | http://www.jkg.in/contact-me/
>> > Jayant Kr. Gandhi | +91-9871412929
>> > M.Tech. Computer Tech. Class of 2007,
>> > D-38, Aravali Hostel, IIT Delhi,
>> > Hauz Khas, Delhi-110016
>> >
>> >
>>
>
>


--
- --
S&P data GmbH
T 06131 218111
F 06131 218112
E [hidden email]
W www.termindoc.de

PGP-Key-ID: 0x0D2E4AE4

Unser Impressum finden Sie unter http://www.termindoc.de/Impressum.htm

Alle Willenserklärungen der S&P data GmbH bedürfen zu ihrer Wirksamkeit
der Schriftform versehen mit zwei Originalunterschriften.

Für viele der Dateien, die Sie von uns erhalten, benötigen Sie zum
Betrachten den Acrobat Reader, den Sie hier erhalten können.
http://www.adobe.de/products/acrobat/readstep2.html