com.gisgraphy.domain.geoloc.service.fulltextsearch
Class FulltextQuery

java.lang.Object
  extended by com.gisgraphy.domain.geoloc.service.AbstractGisQuery
      extended by com.gisgraphy.domain.geoloc.service.fulltextsearch.FulltextQuery

@Configurable
@Component
public class FulltextQuery
extends AbstractGisQuery

A fulltext Query

Author:
David Masclet
See Also:
Pagination, Output, IFullTextSearchEngine

Field Summary
static org.slf4j.Logger logger
          The logger
static int QUERY_MAX_LENGTH
           
 
Fields inherited from class com.gisgraphy.domain.geoloc.service.AbstractGisQuery
output, pagination
 
Constructor Summary
FulltextQuery(javax.servlet.http.HttpServletRequest req)
           
FulltextQuery(java.lang.String query)
           
FulltextQuery(java.lang.String query, Pagination pagination, Output output, java.lang.Class<? extends GisFeature> placeType, java.lang.String countryCode)
           
 
Method Summary
 boolean equals(java.lang.Object obj)
           
 java.lang.String getCountryCode()
           
 int getMaxLimitResult()
           
 java.lang.Class<? extends GisFeature> getPlaceType()
           
 java.lang.String getQuery()
           
 int hashCode()
           
 boolean hasSpellChecking()
          Wether the spellchecking is enabled for this query
 boolean isOutputIndented()
           
 FulltextQuery limitToCountryCode(java.lang.String countryCode)
           
 org.apache.solr.common.params.ModifiableSolrParams parameterize()
           
 java.lang.String toQueryString()
           
 java.lang.String toString()
           
 FulltextQuery withoutSpellChecking()
          Disable the spellchecking for this query
 FulltextQuery withPlaceType(java.lang.Class<? extends GisFeature> placeType)
           
 FulltextQuery withSpellChecking()
          Enable the spellchecking for this query
 
Methods inherited from class com.gisgraphy.domain.geoloc.service.AbstractGisQuery
getFirstPaginationIndex, getLastPaginationIndex, getMaxNumberOfResults, getOutput, getOutputFormat, getOutputLanguage, getOutputStyle, getPagination, withOutput, withPagination
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

QUERY_MAX_LENGTH

public static final int QUERY_MAX_LENGTH
See Also:
Constant Field Values

logger

public static final org.slf4j.Logger logger
The logger

Constructor Detail

FulltextQuery

public FulltextQuery(javax.servlet.http.HttpServletRequest req)
Parameters:
req - an HttpServletRequest to construct a FulltextQuery

FulltextQuery

public FulltextQuery(java.lang.String query,
                     Pagination pagination,
                     Output output,
                     java.lang.Class<? extends GisFeature> placeType,
                     java.lang.String countryCode)
Parameters:
query - The text to query, if the query is a number zipcode will be searched
pagination - The pagination specification, if null : use default
output - Output The output specification , if null : use default
placeType - the type of gis to search , if null : search for all place type.
countryCode - Limit the search to the specified countryCode. If null or wrong it would be ignored (no check is done)
Throws:
An - IllegalArgumentException if the query is null or empty string

FulltextQuery

public FulltextQuery(java.lang.String query)
Parameters:
query - The text to search
Throws:
An - IllegalArgumentException if the query is null or an empty string
Method Detail

getQuery

public java.lang.String getQuery()
Returns:
The searched text for this FullTextQuery

limitToCountryCode

public FulltextQuery limitToCountryCode(java.lang.String countryCode)
Parameters:
countryCode - the countryCode to set. Limit the query to the specified countrycode, if the country code is null, it will be ignored. If null or invalid, it will be ignored (no check is done)

getCountryCode

public java.lang.String getCountryCode()
Returns:
the countryCode of the country that the query will be restricted to

isOutputIndented

public boolean isOutputIndented()
Returns:
Wether the output will be indented
See Also:
Output.isIndented()

getPlaceType

public java.lang.Class<? extends GisFeature> getPlaceType()
Returns:
the placeType : it limits the search to an object of a specifict class

withPlaceType

public FulltextQuery withPlaceType(java.lang.Class<? extends GisFeature> placeType)
Parameters:
placeType - The placeType to set, if null, search for all placetype
Returns:
The current query to chain methods

toString

public java.lang.String toString()
Overrides:
toString in class AbstractGisQuery

withSpellChecking

public FulltextQuery withSpellChecking()
Enable the spellchecking for this query

Returns:
The current query to chain methods

withoutSpellChecking

public FulltextQuery withoutSpellChecking()
Disable the spellchecking for this query

Returns:
The current query to chain methods

hasSpellChecking

public boolean hasSpellChecking()
Wether the spellchecking is enabled for this query

Returns:
The current query to chain methods

toQueryString

public java.lang.String toQueryString()
Returns:
A query string for the specified parameter (starting with '?') the name of the parameters are defined in Constants

parameterize

public org.apache.solr.common.params.ModifiableSolrParams parameterize()
Returns:
A Representation of all the needed parameters

getMaxLimitResult

public int getMaxLimitResult()
Overrides:
getMaxLimitResult in class AbstractGisQuery
Returns:
the maximum number of results that the query should return

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractGisQuery

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class AbstractGisQuery


Copyright © 2010. All Rights Reserved.