lucene-solr-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Fabio Confalonieri <>
Subject Re: Finding documents with undefined field
Date Wed, 07 Jun 2006 14:13:14 GMT

Thank You Hoss (You all are always very responsive...),

actually I've developed my own FacetRequestHandler extending the query
format and adding a showfacet parameter (it's a little custom on our needs,
but I'd like to publish it when we have finished).
What I do is the merge of some ideas from the forum; my query is now in
three parts
where filters is a list of query-clauses separated by commas that I parse to
get filterField and filterValue, then for every filter:

defaultField, req.getSchema()));

then I use filterList in the main query in

    DocListAndSet results =

Then, if requested with showfacets parameter, I get facets extracting and
parsing a facetXML descriptor from a facet-type document in the index,
querying for the facet descriptor of the current category i get from the
filter list (similar to CNET, i think).

To calculate counts for every facet composed of a field and a value, based
on the main query, I use

    facetCount =
searcher.numDocs(QueryParsing.parseQuery("facetField:facetValue", "",
req.getSchema()), results.docSet);

Now, how could I get a fiter for the missing field ?
Can I use the unbounded range trick simply adding a facet (and filter) like

    facetCount = searcher.numDocs(QueryParsing.parseQuery("-fieldName:[* TO
*]", "", req.getSchema()), results.docSet);

...since i use results.docSet of the base query (the same for filters I
think) ?
Or there is a better way ?

Thank You again

View this message in context:
Sent from the Solr - User forum at

View raw message