QueryUtils (Solr 3.6.2 API)
Keywords: org.apache.solr.search.QueryUtils class

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD

## org.apache.solr.search
Class QueryUtils

    java.lang.Object
      org.apache.solr.search.QueryUtils

    public class QueryUtils

extends Object

Version:
  $Id: QueryUtils.java 1172258 2011-09-18 11:42:14Z chrism $

Constructor Summary
`QueryUtils()`

Method Summary
`static Query` | `fixNegativeQuery(Query q)` Fixes a negative query by adding a MatchAllDocs query clause.
`static Query` | `getAbs(Query q)` Returns the original query if it was already a positive query, otherwise return the negative of the query (i.e., a positive query).
`static boolean` | `isNegative(Query q)` return true if this query has no positive components
`static Query` | `makeQueryable(Query q)` Makes negative queries suitable for querying by lucene.

Methods inherited from class java.lang.Object
`clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Constructor Detail

### QueryUtils

    public QueryUtils()

Method Detail

### isNegative

    public static boolean isNegative(Query q)

  return true if this query has no positive components

### getAbs

    public static Query getAbs(Query q)

  Returns the original query if it was already a positive query, otherwise return the negative of the query (i.e., a positive query).

  Example: both id:10 and id:-10 will return id:10

  The caller can tell the sign of the original by a reference comparison between the original and returned query.

  Parameters:
    `q` - Query to create the absolute version of
  Returns:
    Absolute version of the Query

### makeQueryable

    public static Query makeQueryable(Query q)

  Makes negative queries suitable for querying by lucene.

### fixNegativeQuery

    public static Query fixNegativeQuery(Query q)

  Fixes a negative query by adding a MatchAllDocs query clause. The query passed in *must* be a negative query.

Overview | Package | Class | Use | Tree | Deprecated | Index | Help
PREV CLASS NEXT CLASS | FRAMES NO FRAMES
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD