|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object javax.servlet.jsp.tagext.TagSupport info.magnolia.cms.taglibs.util.SimpleSearchTag
public class SimpleSearchTag
A simple tag which allows searching in all the site content with a "natural language" query. It simply strips all the reserved chars from input string, build an xpath query and feed Magnolia QueryManager. By defaults search terms are ANDed, but it also supports using the AND or OR keywords in the query string. Search is not case sensitive and it's performed on any non-binary property. A collection on Content (page) objects is added to the specified scope with the specified name.
Field Summary |
---|
Fields inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
id, pageContext |
Fields inherited from interface javax.servlet.jsp.tagext.IterationTag |
---|
EVAL_BODY_AGAIN |
Fields inherited from interface javax.servlet.jsp.tagext.Tag |
---|
EVAL_BODY_INCLUDE, EVAL_PAGE, SKIP_BODY, SKIP_PAGE |
Constructor Summary | |
---|---|
SimpleSearchTag()
|
Method Summary | |
---|---|
int |
doStartTag()
|
protected String |
generateComplexXPathQuery()
Deprecated. as from 3.5.5, this query is deemed to complex and not properly working, since it forces a search on non-indexed word. The better generateSimpleQuery() method is recommended. |
protected String |
generateSimpleQuery(String input)
This generates a simple jcr:contains query. |
protected String |
generateXPathQuery()
Deprecated. as from 3.5.5, this query is deemed to complex and not properly working, since it forces a search on non-indexed word. The better generateSimpleQuery() method is recommened. |
String |
getItemType()
|
String |
getRepository()
|
String |
getStartPath()
|
boolean |
isSupportSubstringSearch()
|
void |
release()
|
void |
setItemType(String itemType)
The itemTypes search/returned by this tag. |
void |
setQuery(String query)
Query to execute (e.g. |
void |
setRepository(String repository)
The repository we search in. |
void |
setScope(String scope)
Scope for the variable. |
void |
setStartLevel(int startLevel)
The start level for search, defaults to 0. |
void |
setStartPath(String startPath)
The path we search in. |
void |
setSupportSubstringSearch(boolean supportSubstringSearch)
Deprecated. not used when useSimpleJcrQuery is set to true. |
void |
setUseSimpleJcrQuery(boolean useSimpleJcrQuery)
Set this attribute to false to generate the search query as it was generated until Magnolia 3.5.4 (which will force a search on non-indexed word, which usually leads in less good results). |
void |
setVar(String var)
The search results (a collection of Content nodes (pages)) will be added to the pagecontext using this name. |
protected String |
startPath()
|
Methods inherited from class javax.servlet.jsp.tagext.TagSupport |
---|
doAfterBody, doEndTag, findAncestorWithClass, getId, getParent, getValue, getValues, removeValue, setId, setPageContext, setParent, setValue |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public SimpleSearchTag()
Method Detail |
---|
public void setQuery(String query)
public void setVar(String var)
public void setScope(String scope)
public void setStartLevel(int startLevel)
public int doStartTag() throws javax.servlet.jsp.JspException
doStartTag
in interface javax.servlet.jsp.tagext.Tag
doStartTag
in class javax.servlet.jsp.tagext.TagSupport
javax.servlet.jsp.JspException
protected String generateSimpleQuery(String input)
protected String startPath()
protected String generateComplexXPathQuery()
protected String generateXPathQuery()
//*[@jcr:primaryType='mgnl:content']/\*\/\*[jcr:contains(., 'first') or jcr:contains(., 'second')]
.
public void release()
release
in interface javax.servlet.jsp.tagext.Tag
release
in class javax.servlet.jsp.tagext.TagSupport
TagSupport.release()
public String getRepository()
public void setRepository(String repository)
public boolean isSupportSubstringSearch()
public void setSupportSubstringSearch(boolean supportSubstringSearch)
public void setUseSimpleJcrQuery(boolean useSimpleJcrQuery)
public String getItemType()
public void setItemType(String itemType)
public String getStartPath()
public void setStartPath(String startPath)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |