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

## fr.gouv.culture.sdx.search.lucene.queryparser
Interface QueryParser

All Superinterfaces:
  QueryParser

All Known Implementing Classes:
  DefaultQueryParser, ZeroPositionIncrementTokenQueryParser

public interface QueryParser
extends QueryParser

Constructs QueryParser

Field Summary
`static int` | `DEFAULT_OPERATOR`
`static int` | `DEFAULT_PHRASE_SLOP`
`static int` | `OPERATOR_AND`
`static int` | `OPERATOR_OR`

Method Summary
`int` | `getOperator()` Get's the operator
`int` | `getPhraseSlop()` Gets the default slop for phrases.
`org.apache.lucene.search.Query` | `parse(java.lang.String query)` Parses a query string, returning a Query.
`void` | `setOperator(int i)` Set the boolean operator of the QueryParser.
`void` | `setPhraseSlop(int i)` Sets the default slop for phrases.
`void` | `setUp(Analyzer a, int phraseSlop, int operator)` Sets the fields of the query parser
`void` | `setUp(java.lang.String f, Analyzer a)` Sets the fields of the query parser
`void` | `setUp(java.lang.String f, Analyzer a, int phraseSlop, int operator)` Sets the fields of the query parser
`void` | `setUp(java.lang.String f, Analyzer a, SearchLocations sl, int phraseSlop, int operator)` Sets the fields of the query parser

Field Detail

### DEFAULT_OPERATOR

    public static final int DEFAULT_OPERATOR

See Also:
  Constant Field Values

### OPERATOR_OR

    public static final int OPERATOR_OR

See Also:
  Constant Field Values

### OPERATOR_AND

    public static final int OPERATOR_AND

See Also:
  Constant Field Values

### DEFAULT_PHRASE_SLOP

    public static final int DEFAULT_PHRASE_SLOP

See Also:
  Constant Field Values

Method Detail

### setUp

    public void setUp(java.lang.String f,
                      Analyzer a)

  Sets the fields of the query parser

  Parameters:
    `f` - the default field for query terms.
    `a` - used to find terms in the query text.

### setUp

    public void setUp(Analyzer a,
                      int phraseSlop,
                      int operator)

  Sets the fields of the query parser

  Parameters:
    `a` - used to find terms in the query text.
    `phraseSlop` - the slop
    `operator` - the operator

### setUp

    public void setUp(java.lang.String f,
                      Analyzer a,
                      int phraseSlop,
                      int operator)

  Sets the fields of the query parser

  Parameters:
    `f` - the default field for query terms.
    `a` - used to find terms in the query text.
    `phraseSlop` - the slop
    `operator` - the operator

### setUp

    public void setUp(java.lang.String f,
                      Analyzer a,
                      SearchLocations sl,
                      int phraseSlop,
                      int operator)

  Sets the fields of the query parser

  Parameters:
    `f` - the default field for query terms.
    `a` - used to find terms in the query text.
    `sl` - SearchLocations
    `phraseSlop` - the slop
    `operator` - the operator

### parse

    public org.apache.lucene.search.Query parse(java.lang.String query)
                                         throws ParseException,
                                                TokenMgrError

  Parses a query string, returning a Query.

  Parameters:
    `query` - the query string to be parsed.
  Throws:
    `ParseException` - if the parsing fails
    `TokenMgrError` - if ther parsing fails

### getOperator

    public int getOperator()

  Get's the operator

### getPhraseSlop

    public int getPhraseSlop()

  Gets the default slop for phrases.

### setOperator

    public void setOperator(int i)

  Set the boolean operator of the QueryParser. In classic mode (`DEFAULT_OPERATOR_OR) terms without any modifiers are considered optional: for example `capital of Hungary` is equal to `capital OR of OR Hungary`.
  In `DEFAULT_OPERATOR_AND` terms are considered to be in conjuction: the above mentioned query is parsed as `capital AND of AND Hungary`

  `

### setPhraseSlop

    public void setPhraseSlop(int i)

  Sets the default slop for phrases. If zero, then exact phrase matches are required. Zero by default.

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

Copyright © 2000-2007 Ministere de la culture et de la communication / AJLSM. All Rights Reserved.