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
  q=query;sort;filters 
where filters is a list of query-clauses separated by commas that I parse to
get filterField and filterValue, then for every filter:

   
filterList.add(QueryParsing.parseQuery(createQueryString("filterField:filterValue",
defaultField, req.getSchema()));

then I use filterList in the main query in

    DocListAndSet results =
req.getSearcher().getDocListAndSet(query,filterList,sort,...

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
this:

    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

   Fabio
--
View this message in context: 
http://www.nabble.com/Finding-documents-with-undefined-field-t1742872.html#a4751981
Sent from the Solr - User forum at Nabble.com.

Reply via email to