Okie
I am new to this topic
But do u add metatags to a particular field
if so shud not that field also appear as in the field path
The normal nutch maybe does not look at that field at all ? Maybe this is
the reason ?
Unless you give the metadatafield and search for the keyword
Rgds
Prabhu
On 2/23/06, Vanderdray, Jacob <[EMAIL PROTECTED]> wrote:
>
>
> Jérôme,
>
> Thanks for think link you sent earlier. I've read through that
> discussion and I think my problem must be related, but I'm still banging my
> head against it. I'm pretty sure that there's something I'm missing about
> how the queries get added together.
>
> As it stands my query filter seems to modify the ranking, but
> doesn't affect the results returned. I've pasted my code bellow and I'd
> appreciate it if someone could take a look and let me know if they see the
> problem.
>
> Thanks,
> Jake.
>
> public class MetaQueryFilter implements QueryFilter {
>
> private static final Logger LOG = LogFormatter
> .getLogger(MetaQueryFilter.class.getName());
>
> /**
> * Need to pull out the list of meta tags from the configuration
> */
> private static String [] META_TAGS =
> NutchConf.get().getStrings("meta.names");
>
> /**
> * We're going to go through and create search filters for each of the
> meta-tags we were asked to index.
> */
> public BooleanQuery filter(Query input, BooleanQuery output) {
> // If no meta-tags were specified in the conf file, then
> don't bother wasting cycles
> if ( META_TAGS.equals(null) ) {
> return output;
> }
>
> addTerms(input, output);
> return output;
> }
>
> private static void addTerms(Query input, BooleanQuery output) {
> Clause[] clauses = input.getClauses();
> for (int x = 0; x < clauses.length; x++) {
> Clause c = clauses[x];
> if (!c.getField().equals(
> Clause.DEFAULT_FIELD))
> continue; // skip
> non-default fields
>
> // These are the fields we're interested
> in indexing
> String [] tagsToIndex = META_TAGS;
>
> for (int i = 0; i < tagsToIndex.length;
> ++i) {
> LOG.info("Meta Query
> Filter: Adding a search for " + tagsToIndex[i]);
>
> Term term = new
> Term(tagsToIndex[i], c.getTerm().toString());
>
> // add a lucene
> PhraseQuery for this tag
> PhraseQuery metaQuery =
> new PhraseQuery();
> metaQuery.setSlop(0);
> metaQuery.add(term);
>
> // set boost
> metaQuery.setBoost(2.0f);
>
> // add it as a specified
> query
> output.add(metaQuery,
> false, false);
> }
> }
> }
>
> }
>