Esri Geoportal Server
1.0

com.esri.gpt.catalog.lucene
Class LuceneQueryAdapter

java.lang.Object
  extended by com.esri.gpt.catalog.discovery.DiscoveryQueryAdapter
      extended by com.esri.gpt.catalog.lucene.LuceneQueryAdapter

public class LuceneQueryAdapter
extends DiscoveryQueryAdapter

Adapts a catalog discovery query to the Lucene model.


Constructor Summary
LuceneQueryAdapter()
          Default constructor.
 
Method Summary
 void execute(RequestContext context, DiscoveryQuery discoveryQuery)
          Executes a query for metadata documents.
protected  void executeQuery(DiscoveryQuery discoveryQuery)
          Executes a query against a Lucene index.
protected  boolean getHasScoredExpression()
          Gets the flag indicating whether or not a scored expression exists within the query.
protected  LuceneIndexAdapter getIndexAdapter()
          Gets the index adapter.
protected  int getMaxDoc()
          Gets the maxDoc() count returned by the Lucene IndexSearcher.
protected  void setHasScoredExpression(boolean hasScoredExpression)
          Sets the flag indicating whether or not a scored expression exists within the query.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LuceneQueryAdapter

public LuceneQueryAdapter()
Default constructor.

Method Detail

getHasScoredExpression

protected boolean getHasScoredExpression()
Gets the flag indicating whether or not a scored expression exists within the query.

This flag supports relevance sorting.

Returns:
true if a scored expression exists

setHasScoredExpression

protected void setHasScoredExpression(boolean hasScoredExpression)
Sets the flag indicating whether or not a scored expression exists within the query.

This flag supports relevance sorting.

Parameters:
hasScoredExpression - true if a scored expression exists

getIndexAdapter

protected LuceneIndexAdapter getIndexAdapter()
Gets the index adapter.

Returns:
the index adapter

getMaxDoc

protected int getMaxDoc()
Gets the maxDoc() count returned by the Lucene IndexSearcher.

Returns:
the index adapter

execute

public void execute(RequestContext context,
                    DiscoveryQuery discoveryQuery)
             throws DiscoveryException
Executes a query for metadata documents.

Specified by:
execute in class DiscoveryQueryAdapter
Parameters:
context - the active request context
discoveryQuery - the query to execute
Throws:
DiscoveryException - if an exception occurs

executeQuery

protected void executeQuery(DiscoveryQuery discoveryQuery)
                     throws DiscoveryException,
                            ParseException,
                            CorruptIndexException,
                            IOException
Executes a query against a Lucene index.

Parameters:
discoveryQuery - the query to execute
Throws:
DiscoveryException
ParseException
CorruptIndexException
IOException

Esri Geoportal Server
1.0

Copyright 2011 Environmental Systems Research Institute. All rights reserved. Use is subject to license terms.