If I perform such a query I still get 0 hits...

Here's my plugin.xml files:

------------------ Indexing plugin -----------------------

<?xml version="1.0" encoding="UTF-8"?>
<plugin
       id="index-quiew"
       name="Quiew Indexing Filter"
       version="1.0.0"
       provider-name="nutch.org">

    <extension-point
            id="org.apache.nutch.indexer.IndexingFilter"
            name="Nutch Indexing Filter"/>

    <runtime>
        <library name="index-quiew.jar">
            <export name="*"/>
        </library>
    </runtime>

    <extension id="org.apache.nutch.indexer.quiew"
           name="Nutch Quiew Indexing Filter"
           point="org.apache.nutch.indexer.IndexingFilter">
        <implementation id="QuiewIndexingFilter"
                class="org.apache.nutch.indexer.quiew.QuiewIndexingFilter"/>
    </extension>

</plugin>

---------------- Query plugin ----------------------
<?xml version="1.0" encoding="UTF-8"?>
<plugin
   id="query-quiew"
   name="Quiew Query Filter"
   version="1.0.0"
   provider-name="nutch.org">

   <extension-point
      id="org.apache.nutch.searcher.QueryFilter"
      name="Nutch Query Filter"/>

   <runtime>
      <library name="query-quiew.jar">
         <export name="*"/>
      </library>
   </runtime>


   <extension id="org.apache.nutch.searcher.quiew.QuiewQueryFilter"
              name="Nutch URL Query Filter"
              point="org.apache.nutch.searcher.QueryFilter">
      <implementation id="URLQueryFilter"
                      class="
org.apache.nutch.searcher.quiew.QuiewQueryFilter"
                      fields="url"/>
   </extension>

</plugin>

Clearly I enabled the plugins in the nutch-site.xml file... :-)

Thanks for your replies!

Enrico

On 1/31/06, Vanderdray, Jacob <[EMAIL PROTECTED]> wrote:
>
> Enrico,
>
>         What does your plugin.xml file look like?  Also, what happens if
> you do a search for:
>
> quiewId:a3d32ce0cae0da47677f30cc6182d421
> [A_word_found_in_the_body_of_the_document]
>
> Jake.
>
> -----Original Message-----
> From: Enrico Triolo [mailto:[EMAIL PROTECTED]
> Sent: Tuesday, January 31, 2006 7:59 AM
> To: [email protected]
> Subject: Re: Problem with plugins
>
> Quite interesting (I think), if I use lucene api to perform the query I
> get
> exactly what I'm expecting...
>
> Searcher searcher = new IndexSearcher(indexDir);
> Analyzer analyzer = new NutchDocumentAnalyzer();
> Query query = QueryParser.parse("a3d32ce0cae0da47677f30cc6182d421",
> "quiewId", analyzer);
>
> System.out.println(query);
> System.out.println("Searching for: " + query.toString("quiewId"));
>
> Hits hits = searcher.search(query);
> System.out.println(hits.length() + " total matching documents");
>
> Do you have any suggestion?
>
> Thanks,
> Enrico
>
>
> On 1/31/06, Enrico Triolo <[EMAIL PROTECTED]> wrote:
> >
> > No... :-(
> > What would it be supposed to do?
> >
> > Enrico
> >
> > On 1/31/06, Stefan Groschupf <[EMAIL PROTECTED]> wrote:
> > >
> > > What happens if you change your query string to:
> > > String query = "quiewId:a3d32ce0cae0da47677f30cc6182d421 HTTP" ;
> > > (adding space http)??
> > > Does this return any hits?
> > >
> > > Stefan
> > >
> > > Am 31.01.2006 um 12:05 schrieb Enrico Triolo:
> > >
> > > > Hi all, I developed a couple of plugins to add and search a custom
> > > > field.
> > > > The indexing plugin works fine (with Luke I can see the field is
> > > > added to
> > > > the index). But when it comes to search no documents are
> returned...
> > > >
> > > > Here the plugins code:
> > > >
> > > > ----------------- Indexing plugin ---------------------------
> > > >
> > > > package org.apache.nutch.indexer.quiew;
> > > >
> > > > import ...;
> > > >
> > > > public class QuiewIndexingFilter implements IndexingFilter {
> > > >
> > > >   public Document filter(Document doc, Parse parse, FetcherOutput
> fo)
> > > >     throws IndexingException {
> > > >
> > > >     String url = fo.getUrl().toString();
> > > >     doc.add(new Field("quiewId", MD5Hash.digest(url).toString(),
> > > > true, true,
> > > > false));
> > > >
> > > >     return doc;
> > > >   }
> > > >
> > > > }
> > > >
> > > > ---------------- Query plugin ----------------------
> > > > package org.apache.nutch.searcher.quiew;
> > > >
> > > > import org.apache.nutch.searcher.FieldQueryFilter ;
> > > >
> > > > public class QuiewQueryFilter extends FieldQueryFilter {
> > > >
> > > >     public QuiewQueryFilter() {
> > > >         super("quiewId");
> > > >     }
> > > > }
> > > >
> > > > And here's how I try to perform the query:
> > > >
> > > > String query = "quiewId:a3d32ce0cae0da47677f30cc6182d421";
> > > > NutchBean bean = new NutchBean(new File(indexPath));
> > > > Query q = Query.parse(query);
> > > > Hits hits = bean.search(q, 1000);
> > > > long tot = hits.getTotal();
> > > >
> > > > System.out.println("Query returned " + tot + " hits.");
> > > >
> > > > for(int i = 0; i < tot; i++) {
> > > >
> > > >    Hit hit = hits.getHit(i);
> > > >    HitDetails details = bean.getDetails(hit);
> > > >
> > > >    System.out.println("Resource title: " +
> details.getValue("title"));
> > > >    System.out.println("Resource url: " + details.getValue("url"));
> > > > }
> > > >
> > > > If I perform the same query with Luke, I get correct results, but
> > > > only if I
> > > > use the KeywordAnalyzer...
> > > >
> > > > What am I doing wrong?
> > > >
> > > > Thanks,
> > > > Enrico
> > >
> > >
> >
>

Reply via email to