com.atlassian.jira.issue.search.parameters.lucene
Class MultipleFieldSingleValueLuceneParameter

java.lang.Object
  extended by com.atlassian.jira.issue.search.parameters.AbstractSearchParameter
      extended by com.atlassian.jira.issue.search.parameters.AbstractLuceneParameter
          extended by com.atlassian.jira.issue.search.parameters.lucene.MultipleFieldSingleValueLuceneParameter
All Implemented Interfaces:
CommentParameter, IssueParameter, LuceneParameter, SearchParameter

public class MultipleFieldSingleValueLuceneParameter
extends AbstractLuceneParameter
implements IssueParameter, CommentParameter

This is a parameter that will search multiple Lucene fields for a single query


Constructor Summary
MultipleFieldSingleValueLuceneParameter()
           
MultipleFieldSingleValueLuceneParameter(Collection fields, String query)
           
 
Method Summary
 boolean equals(Object o)
           
 org.apache.lucene.search.Query getCommentQuery(Set projectIds, User searcher)
           
 List getFields()
           
 org.apache.lucene.search.Query getIssueQuery(org.ofbiz.core.entity.GenericValue project, User searcher)
           
 org.apache.lucene.search.Query getQuery(org.ofbiz.core.entity.GenericValue project, User searcher)
           
 String getQueryString()
          Returns the query string
protected  String getQueryStringPrefix()
          Query parameter name, suitable for inclusion in URL.
 electric.xml.Element getXml()
          Return an XML elemnt representation of this search parameter.
 int hashCode()
           
 boolean isValid()
          Returns true if this parameter is valid, false otherwise.
 void setXml(electric.xml.Element el)
          Initialise this search parameter using an XML element.
 
Methods inherited from class com.atlassian.jira.issue.search.parameters.AbstractSearchParameter
addValue, clearValues, getName, getValues, setName, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.jira.issue.search.SearchParameter
addValue, getName, getValues, setName
 

Constructor Detail

MultipleFieldSingleValueLuceneParameter

public MultipleFieldSingleValueLuceneParameter()

MultipleFieldSingleValueLuceneParameter

public MultipleFieldSingleValueLuceneParameter(Collection fields,
                                               String query)
Method Detail

getFields

public List getFields()

getIssueQuery

public org.apache.lucene.search.Query getIssueQuery(org.ofbiz.core.entity.GenericValue project,
                                                    User searcher)
                                             throws org.apache.lucene.queryParser.ParseException
Specified by:
getIssueQuery in interface IssueParameter
Throws:
org.apache.lucene.queryParser.ParseException

getCommentQuery

public org.apache.lucene.search.Query getCommentQuery(Set projectIds,
                                                      User searcher)
                                               throws org.apache.lucene.queryParser.ParseException
Specified by:
getCommentQuery in interface CommentParameter
Throws:
org.apache.lucene.queryParser.ParseException

getQuery

public org.apache.lucene.search.Query getQuery(org.ofbiz.core.entity.GenericValue project,
                                               User searcher)
                                        throws org.apache.lucene.queryParser.ParseException
Specified by:
getQuery in interface LuceneParameter
Returns:
a collection of Query objects.
Throws:
org.apache.lucene.queryParser.ParseException

getXml

public electric.xml.Element getXml()
Description copied from interface: SearchParameter
Return an XML elemnt representation of this search parameter.

Specified by:
getXml in interface SearchParameter
Specified by:
getXml in class AbstractSearchParameter
Returns:
XML element

setXml

public void setXml(electric.xml.Element el)
Description copied from interface: SearchParameter
Initialise this search parameter using an XML element.

Usual process is:

    SearchParameter param = new MySearchParameter();
    param.setXml(element);
 

Specified by:
setXml in interface SearchParameter
Overrides:
setXml in class AbstractSearchParameter
Parameters:
el - XML element

isValid

public boolean isValid()
Description copied from interface: SearchParameter
Returns true if this parameter is valid, false otherwise.

Specified by:
isValid in interface SearchParameter
Specified by:
isValid in class AbstractSearchParameter
Returns:
true if valid, false otherwise

equals

public boolean equals(Object o)
Overrides:
equals in class AbstractSearchParameter

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractSearchParameter

getQueryString

public String getQueryString()
Description copied from interface: SearchParameter
Returns the query string

Specified by:
getQueryString in interface SearchParameter
Overrides:
getQueryString in class AbstractSearchParameter
Returns:
query string

getQueryStringPrefix

protected String getQueryStringPrefix()
Description copied from class: AbstractSearchParameter
Query parameter name, suitable for inclusion in URL. Note that implementations of this method should ensure that the values that they return are URLEncoded, perhaps using the URLEncoder.encode(String) method.

Overrides:
getQueryStringPrefix in class AbstractSearchParameter
Returns:
nothing, always throws UnsupportedOperationException


Copyright © 2002-2008 Atlassian. All Rights Reserved.