Package org.ametys.web.frontoffice
Class SearchGenerator
-
- All Implemented Interfaces:
SolrFieldNames,SolrWebFieldNames,Poolable,Recyclable,Disposable,Component,Contextualizable,LogEnabled,Serviceable,Generator,SitemapModelComponent,XMLProducer
- Direct Known Subclasses:
FrontODFSearch
public class SearchGenerator extends AbstractSearchGenerator
Generates the results of a search performed on front office
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description protected static classSearchGenerator.ContentTypeSearchEnumeration for content type search(package private) static classSearchGenerator.ContentTypeSearchField-
Nested classes/interfaces inherited from class org.ametys.web.frontoffice.AbstractSearchGenerator
AbstractSearchGenerator.AttributeFacetField, AbstractSearchGenerator.ContentTypeFacetField, AbstractSearchGenerator.FacetField
-
-
Field Summary
Fields Modifier and Type Field Description private static String__FACETS_CACHEprotected QueryAdapterFOSearchExtensionPoint_queryAdapterFOSearchEPThe query adapter extension pointprotected SiteTypesExtensionPoint_siteTypeEPThe site type manager-
Fields inherited from class org.ametys.web.frontoffice.AbstractSearchGenerator
_contentTypesHelper, _context, _cTypeExtPt, _resolver, _searcherFactory, _searchHelper, _siteManager, _tagExtPt, _TEXTFIELD_PATTERN, _uriResolverEP, DOCUMENT_TYPE_IS_PAGE_RESOURCE_FACET_NAME
-
Fields inherited from class org.apache.cocoon.generation.ServiceableGenerator
manager
-
Fields inherited from class org.apache.cocoon.generation.AbstractGenerator
objectModel, parameters, resolver, source
-
Fields inherited from class org.apache.cocoon.xml.AbstractXMLProducer
contentHandler, EMPTY_CONTENT_HANDLER, lexicalHandler, xmlConsumer
-
Fields inherited from interface org.ametys.cms.content.indexing.solr.SolrFieldNames
ACL_INIT_VALUE_ALLOWED_GROUPS, ACL_INIT_VALUE_ALLOWED_USERS, ACL_INIT_VALUE_ANONYMOUS, ACL_INIT_VALUE_ANYCONNECTED, ACL_INIT_VALUE_DENIED_GROUPS, ACL_INIT_VALUE_DENIED_USERS, ALL_CONTENT_TYPES, ALL_MIXIN_TYPES, ALL_TAGS, ATTACHMENT_CONTENT_ID, CONTENT_COMMENTS, CONTENT_COMMENTS_NONVALIDATED, CONTENT_COMMENTS_VALIDATED, CONTENT_CREATOR, CONTENT_LANGUAGE, CONTENT_LANGUAGES, CONTENT_LAST_CONTRIBUTOR, CONTENT_NAME, CONTENT_OUTGOING_REFEERENCES_RESOURCE_IDS, CONTENT_TITLES, CONTENT_TYPE_RESOURCE, CONTENT_TYPES, CONTENT_VISIBLE_ATTACHMENT_RESOURCE_IDS, CREATION_DATE, DC_CONTRIBUTOR, DC_COVERAGE, DC_CREATOR, DC_DATE, DC_DESCRIPTION, DC_FORMAT, DC_IDENTIFIER, DC_LANGUAGE, DC_PUBLISHER, DC_RELATION, DC_RIGHTS, DC_SOURCE, DC_SUBJECT, DC_TITLE, DC_TYPE, DOCUMENT_TYPE, EXCERPT, FILENAME, FIRST_VALIDATION, FULL_EXACT_WS, FULL_GENERAL, FULL_PREFIX, FULL_STEMMED_PREFIX, ID, IS_AMETYS_OBJECT, LAST_MAJOR_VALIDATION, LAST_MODIFIED, LAST_VALIDATION, LENGTH, MIME_TYPES, MIXIN_TYPES, PATH, PSEUDO_CONTENT_TYPE_VALUE_RESOURCE, PSEUDO_CONTENT_TYPES, REPEATER_ENTRY_POSITION, RESOURCE_ANCESTOR_AND_SELF_IDS, RESOURCE_ANCESTOR_IDS, RESOURCE_CREATOR, RESOURCE_DATE, RESOURCE_LAST_MODIFIED, RESOURCE_MIME_TYPE_GROUP, RESOURCE_ROOT_ID, SIMPLE_CONTENT_PARENTS, SUB_CONTENT, TAGS, TITLE, TITLE_SORT, TYPE_CONTENT, TYPE_CONTENT_ATTACHMENT_RESOURCE, TYPE_CONTENT_ATTRIBUTE_RESOURCE, TYPE_REPEATER, TYPE_RESOURCE, TYPE_WF_ENTRY, TYPE_WF_STEP, WORKFLOW_CURRENT_STEPS, WORKFLOW_CURRENT_STEPS_DV, WORKFLOW_ENTRY_STATE, WORKFLOW_HISTORY_STEPS, WORKFLOW_HISTORY_STEPS_DV, WORKFLOW_NAME, WORKFLOW_REF, WORKFLOW_REF_DV, WORKFLOW_STEP, WORKFLOW_STEP_ACTIONID, WORKFLOW_STEP_CALLER, WORKFLOW_STEP_DUEDATE, WORKFLOW_STEP_FINISHDATE, WORKFLOW_STEP_ID, WORKFLOW_STEP_OWNER, WORKFLOW_STEP_STARTDATE, WORKFLOW_STEP_STATUS
-
Fields inherited from interface org.ametys.web.indexing.solr.SolrWebFieldNames
ATTACHMENT_PAGE_ID, CONTENT_IDS, CONTENT_INTERESTING_DATES, DATE_FOR_SORTING, DATES_FACET, FACETABLE_CONTENT_FIELD_PREFIX, LASTNAME_FOR_SORTING, ORPHAN, PAGE_ANCESTOR_IDS, PAGE_CONTENT_TYPES, PAGE_DEPTH, PAGE_IDS, PAGE_LONG_TITLE, PAGE_OUTGOING_REFEERENCES_RESOURCE_IDS, PAGE_PARENT_ID, PAGE_TITLE, PAGE_TYPE, PAGE_VISIBLE_ATTACHMENT_RESOURCE_IDS, PRIVACY, SECTION_PAGE_TITLE, SERVICE_IDS, SHARED, SITE_NAME, SITE_TYPE, SITEMAP_NAME, TEMPLATE, TYPE_PAGE, TYPE_PAGE_RESOURCE
-
-
Constructor Summary
Constructors Constructor Description SearchGenerator()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void_addAttributeFacet(Map<String,AbstractSearchGenerator.FacetField> facets, Collection<String> contentTypes, String attributePath)Add attribute facet to facets mapprotected void_additionalSearchProcessing(SearcherFactory.Searcher searcher)Allow to perform other searcher configurationprivate String_buildSubQuery(Query subQuery)private String_escapedTextForSearch(String value)private String_escapeQueryCharsButNotQuotes(String text)private Set<String>_getAllContentTypes()private Collection<String>_getAvailableContentTypes(Request request)private Expression_getContentTypeExpression(String parentCTypeId)private Map<String,Integer>_getFacetQueryResults(SearchResults<AmetysObject> results)private ModelItem_getModelItemFromContentTypes(Collection<String> contentTypeIds, String attributePath)private int_getNbResource(Map<String,Integer> facetQueryResults)private SearchResults<AmetysObject>_getResultsForContentType(Query queryObject, Collection<Query> filterQueries, Collection<SearchField> facets, List<Sort> sorts, Map<String,List<String>> initialFacetValues, String forceContentType)private List<QueryAdapterFOSearch>_getSortedListQueryAdapter()protected Query_getStringAttributeQuery(String language, String attributePath, String value, ModelItem modelItem)Get query from string attributeprivate void_handleFacetResults(Request request, int start, int maxResults, SearchResults<AmetysObject> results, String currentCtype)private boolean_isPrivate(Site site)private void_saxAllWords(Request request)private void_saxAttributeCriteria(Request request, String language)private void_saxContentType(Request request)private void_saxContentTypeCriteria(Request request)private void_saxDates(Request request)private void_saxExactWording(Request request)private void_saxMetadataValues(Request request)private void_saxMultisite(Request request)private void_saxNoWords(Request request)private void_saxPages(Request request)private void_saxSitemapCriteria()private void_saxTag(Tag tag, boolean recursive)private void_saxTags(Request request)private void_saxTagsCriteria(String siteName)private void_saxTextField(Request request)private LocalDate_toDate(String dateStr)protected voidaddAllWordsTextFieldQuery(Collection<Query> queries, String language, Request request)Add content query for "all words"protected voidaddAttributeQuery(Collection<Query> queries, String language, Request request)Add query for each attributeprotected voidaddContentTypeQuery(Collection<Query> queries, Request request)Add the content type queryprotected voidaddDateQuery(Collection<Query> queries, Request request)Add the query on start and end datesprotected voidaddExactWordingTextFieldQuery(Collection<Query> queries, String language, Request request)Add content query for exact wording or phraseprotected voidaddNoWordsTextFieldQuery(Collection<Query> queries, String language, Request request)Add content query for "none of these words"protected voidaddPagesQuery(Collection<Query> queries, Request request)Add the pages queryprotected voidaddTagsQuery(Collection<Query> queries, Request request)Add the tags queryprotected voidaddTextFieldQuery(Collection<Query> queries, String language, Request request)Add the text field queryprotected List<Query>getContentQueries(Request request, Collection<String> siteNames, String language)Get the queries to be apply on joined contents ONLYprotected List<Query>getContentResourcesOrAttachmentQueries(Query subQuery)Get the queries for content's attachments and resourcesprotected StringgetContentTypeFilterValue(Request request)Get the content type's filter valueprotected Collection<String>getContentTypes(Request request)Get the content type'sprotected SearchGenerator.ContentTypeSearchgetContentTypeSearch(Request request)Return the type of content type's searchprotected Map<String,String>getContentValues(String cTypeId, String language)Get values for contents enumerationprotected Collection<String>getDocumentTypes(Request request)Get the document types.protected Map<String,AbstractSearchGenerator.FacetField>getFacets(Request request)Get the facets from request parametersprotected Map<String,List<String>>getFacetValues(Request request, Collection<String> siteNames, String language)Get the facet valuesprotected Collection<String>getFields()Get the searchable fieldsprotected Collection<Query>getFilterQueries(Request request, Collection<String> siteNames, String language)Get the filter queries from the request parameters.protected Collection<Query>getFixedCTypeFilterQueries(Request request, String cType, Collection<String> siteNames, String language)Get the filter queries for a single fixed content type.protected List<Query>getPageQueries(Request request, Collection<String> siteNames, String language)Get the queries to be apply on pages ONLYprotected List<Query>getPageResourcesOrAttachmentQueries(Query subQuery)Get the queries for page's attachments and resourcesprotected List<Sort>getPrimarySortFields(Request request)Get the primary sort fieldsprotected QuerygetQuery(Request request, Collection<String> siteNames, String language)Get the query from request parametersprotected Set<FrontOfficeSearcherFactory.QueryFacet>getQueryFacets(Request request)Get the facet.queriesprotected Collection<String>getQueryFacetValues(Request request)Get the facet.query valuesprotected SortgetSortField(Request request)Get the sort fieldprotected List<Query>getWordingQueries(Request request, Collection<String> siteNames, String language)Get the queries on wording (keywords, no words, exact wording, no words)protected voidsaxAttributeDefinition(ModelItem modelItem, String attributePath, String language)Sax metadata set information for metadataprotected voidsaxEnumeratorValueForAttribute(ModelItem modelItem, String attributePath, String language)Sax enumeration value for enum or a content attributeprotected voidsaxFormFields(Request request, String siteName, String lang)SAX the form search criteriaprotected voidsaxFormValues(Request request, int start, int offset)SAX the form search criteria valuesprotected voidsaxHits(SearchResults<AmetysObject> results, int start, int maxResults)SAX the result hitsprotected SearchResults<AmetysObject>search(Request request, Collection<String> siteNames, String language, int pageIndex, int start, int maxResults)Searchvoidservice(ServiceManager smanager)-
Methods inherited from class org.ametys.web.frontoffice.AbstractSearchGenerator
contextualize, generate, getDocumentTypesQuery, getPageIndex, getSearchMode, getZoneItem, isInputValid, saxAdditionalInfos, saxAdditionalInfosOnPageHit, saxContent, saxFacets, saxFormParameters, saxPageHit, saxPagination, saxResourceHit, saxRichTextExcerpt, saxServiceIdentifiers, saxSort, search, useFacets
-
Methods inherited from class org.apache.cocoon.generation.ServiceableGenerator
dispose
-
Methods inherited from class org.apache.cocoon.generation.AbstractGenerator
recycle, setup
-
Methods inherited from class org.apache.cocoon.xml.AbstractXMLProducer
setConsumer, setContentHandler, setLexicalHandler
-
Methods inherited from class org.apache.avalon.framework.logger.AbstractLogEnabled
enableLogging, getLogger, setupLogger, setupLogger, setupLogger
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.apache.cocoon.xml.XMLProducer
setConsumer
-
-
-
-
Field Detail
-
__FACETS_CACHE
private static final String __FACETS_CACHE
-
_queryAdapterFOSearchEP
protected QueryAdapterFOSearchExtensionPoint _queryAdapterFOSearchEP
The query adapter extension point
-
_siteTypeEP
protected SiteTypesExtensionPoint _siteTypeEP
The site type manager
-
-
Constructor Detail
-
SearchGenerator
public SearchGenerator()
-
-
Method Detail
-
service
public void service(ServiceManager smanager) throws ServiceException
- Specified by:
servicein interfaceServiceable- Overrides:
servicein classAbstractSearchGenerator- Throws:
ServiceException
-
getContentTypeSearch
protected SearchGenerator.ContentTypeSearch getContentTypeSearch(Request request)
Return the type of content type's search- Parameters:
request- The request- Returns:
- The type of search
-
search
protected SearchResults<AmetysObject> search(Request request, Collection<String> siteNames, String language, int pageIndex, int start, int maxResults) throws Exception
Description copied from class:AbstractSearchGeneratorSearch- Overrides:
searchin classAbstractSearchGenerator- Parameters:
request- the requestsiteNames- The name of the sites to search inlanguage- The language code to searchpageIndex- the page indexstart- The offset for search resultsmaxResults- The maximum number of results- Returns:
- The search results
- Throws:
Exception- If an error occurred during search
-
_getFacetQueryResults
private Map<String,Integer> _getFacetQueryResults(SearchResults<AmetysObject> results)
-
_getNbResource
private int _getNbResource(Map<String,Integer> facetQueryResults)
-
_getResultsForContentType
private SearchResults<AmetysObject> _getResultsForContentType(Query queryObject, Collection<Query> filterQueries, Collection<SearchField> facets, List<Sort> sorts, Map<String,List<String>> initialFacetValues, String forceContentType) throws Exception
- Throws:
Exception
-
_additionalSearchProcessing
protected void _additionalSearchProcessing(SearcherFactory.Searcher searcher)
Description copied from class:AbstractSearchGeneratorAllow to perform other searcher configuration- Overrides:
_additionalSearchProcessingin classAbstractSearchGenerator- Parameters:
searcher- The searcher that will be used for the search operation
-
_handleFacetResults
private void _handleFacetResults(Request request, int start, int maxResults, SearchResults<AmetysObject> results, String currentCtype) throws SAXException, IOException
- Throws:
SAXExceptionIOException
-
getQuery
protected Query getQuery(Request request, Collection<String> siteNames, String language) throws IllegalArgumentException
Description copied from class:AbstractSearchGeneratorGet the query from request parameters- Specified by:
getQueryin classAbstractSearchGenerator- Parameters:
request- The requestsiteNames- The site names.language- The language- Returns:
- The query object.
- Throws:
IllegalArgumentException- If the search field is invalid.
-
getWordingQueries
protected List<Query> getWordingQueries(Request request, Collection<String> siteNames, String language)
Get the queries on wording (keywords, no words, exact wording, no words)- Parameters:
request- the requestsiteNames- the site nameslanguage- the language- Returns:
- the queries on wording
-
getContentQueries
protected List<Query> getContentQueries(Request request, Collection<String> siteNames, String language)
Get the queries to be apply on joined contents ONLY- Parameters:
request- the requestsiteNames- the site nameslanguage- the language- Returns:
- the queries for contents only
-
getPageQueries
protected List<Query> getPageQueries(Request request, Collection<String> siteNames, String language)
Get the queries to be apply on pages ONLY- Parameters:
request- the requestsiteNames- the site nameslanguage- the language- Returns:
- the queries for pages only
-
getFilterQueries
protected Collection<Query> getFilterQueries(Request request, Collection<String> siteNames, String language) throws IllegalArgumentException
Description copied from class:AbstractSearchGeneratorGet the filter queries from the request parameters.- Specified by:
getFilterQueriesin classAbstractSearchGenerator- Parameters:
request- The request.siteNames- The site names.language- The language.- Returns:
- A collection of filter queries.
- Throws:
IllegalArgumentException- If a search field is invalid.
-
getFacetValues
protected Map<String,List<String>> getFacetValues(Request request, Collection<String> siteNames, String language) throws IllegalArgumentException
Description copied from class:AbstractSearchGeneratorGet the facet values- Specified by:
getFacetValuesin classAbstractSearchGenerator- Parameters:
request- The requestsiteNames- The site nameslanguage- The language- Returns:
- The facet values
- Throws:
IllegalArgumentException
-
getQueryFacetValues
protected Collection<String> getQueryFacetValues(Request request)
Description copied from class:AbstractSearchGeneratorGet the facet.query values- Specified by:
getQueryFacetValuesin classAbstractSearchGenerator- Parameters:
request- The request- Returns:
- The facet.query values
-
getFacets
protected Map<String,AbstractSearchGenerator.FacetField> getFacets(Request request) throws IllegalArgumentException
Description copied from class:AbstractSearchGeneratorGet the facets from request parameters- Specified by:
getFacetsin classAbstractSearchGenerator- Parameters:
request- The request- Returns:
- The facet fields
- Throws:
IllegalArgumentException- If the search field is invalid.
-
_addAttributeFacet
protected void _addAttributeFacet(Map<String,AbstractSearchGenerator.FacetField> facets, Collection<String> contentTypes, String attributePath)
Add attribute facet to facets map- Parameters:
facets- the facets mapcontentTypes- the content typesattributePath- the attribute path
-
getQueryFacets
protected Set<FrontOfficeSearcherFactory.QueryFacet> getQueryFacets(Request request)
Description copied from class:AbstractSearchGeneratorGet the facet.queries- Specified by:
getQueryFacetsin classAbstractSearchGenerator- Parameters:
request- The request- Returns:
- The facet.queries
-
getFixedCTypeFilterQueries
protected Collection<Query> getFixedCTypeFilterQueries(Request request, String cType, Collection<String> siteNames, String language)
Get the filter queries for a single fixed content type.- Parameters:
request- The request.cType- The fixed content type.siteNames- the site names.language- The language.- Returns:
- The filter queries.
-
getDocumentTypes
protected Collection<String> getDocumentTypes(Request request)
Description copied from class:AbstractSearchGeneratorGet the document types.- Specified by:
getDocumentTypesin classAbstractSearchGenerator- Parameters:
request- The request.- Returns:
- the document types to search.
-
getFields
protected Collection<String> getFields()
Description copied from class:AbstractSearchGeneratorGet the searchable fields- Specified by:
getFieldsin classAbstractSearchGenerator- Returns:
- The fields
-
saxHits
protected void saxHits(SearchResults<AmetysObject> results, int start, int maxResults) throws SAXException, IOException
Description copied from class:AbstractSearchGeneratorSAX the result hits- Specified by:
saxHitsin classAbstractSearchGenerator- Parameters:
results- The search results.start- The start indexmaxResults- The number of results to generate.- Throws:
SAXException- If an error occurs while SAXingIOException- If there is a low-level IO error
-
getSortField
protected Sort getSortField(Request request)
Description copied from class:AbstractSearchGeneratorGet the sort field- Specified by:
getSortFieldin classAbstractSearchGenerator- Parameters:
request- The request- Returns:
- The sort field or null to sort by score
-
getPrimarySortFields
protected List<Sort> getPrimarySortFields(Request request)
Description copied from class:AbstractSearchGeneratorGet the primary sort fields- Specified by:
getPrimarySortFieldsin classAbstractSearchGenerator- Parameters:
request- The request- Returns:
- the list additional sort fields or empty list.
-
saxFormFields
protected void saxFormFields(Request request, String siteName, String lang) throws SAXException
Description copied from class:AbstractSearchGeneratorSAX the form search criteria- Specified by:
saxFormFieldsin classAbstractSearchGenerator- Parameters:
request- The requestsiteName- The current site namelang- The current language- Throws:
SAXException- if an error occurs while SAXing
-
_isPrivate
private boolean _isPrivate(Site site)
-
_saxAttributeCriteria
private void _saxAttributeCriteria(Request request, String language) throws SAXException
- Throws:
SAXException
-
saxAttributeDefinition
protected void saxAttributeDefinition(ModelItem modelItem, String attributePath, String language) throws SAXException
Sax metadata set information for metadata- Parameters:
modelItem- The metadata definition.attributePath- The metadata pathlanguage- The current language- Throws:
SAXException- If an error occurred while saxing
-
saxEnumeratorValueForAttribute
protected void saxEnumeratorValueForAttribute(ModelItem modelItem, String attributePath, String language) throws SAXException
Sax enumeration value for enum or a content attribute- Parameters:
modelItem- The attribute definition.attributePath- The attribute pathlanguage- The current language- Throws:
SAXException- If an error occurred while saxing
-
getContentValues
protected Map<String,String> getContentValues(String cTypeId, String language)
Get values for contents enumeration- Parameters:
cTypeId- The id of content typelanguage- The current language- Returns:
- The contents
-
_getContentTypeExpression
private Expression _getContentTypeExpression(String parentCTypeId)
-
saxFormValues
protected void saxFormValues(Request request, int start, int offset) throws SAXException
Description copied from class:AbstractSearchGeneratorSAX the form search criteria values- Specified by:
saxFormValuesin classAbstractSearchGenerator- Parameters:
request- The requeststart- The start indexoffset- The number of results- Throws:
SAXException- if an error occurs while SAXing
-
_saxDates
private void _saxDates(Request request) throws SAXException
- Throws:
SAXException
-
_saxTextField
private void _saxTextField(Request request) throws SAXException
- Throws:
SAXException
-
_saxMetadataValues
private void _saxMetadataValues(Request request) throws SAXException
- Throws:
SAXException
-
_saxAllWords
private void _saxAllWords(Request request) throws SAXException
- Throws:
SAXException
-
_saxExactWording
private void _saxExactWording(Request request) throws SAXException
- Throws:
SAXException
-
_saxNoWords
private void _saxNoWords(Request request) throws SAXException
- Throws:
SAXException
-
_saxContentType
private void _saxContentType(Request request) throws SAXException
- Throws:
SAXException
-
_saxTags
private void _saxTags(Request request) throws SAXException
- Throws:
SAXException
-
_saxPages
private void _saxPages(Request request) throws SAXException
- Throws:
SAXException
-
_saxMultisite
private void _saxMultisite(Request request) throws SAXException
- Throws:
SAXException
-
getContentTypes
protected Collection<String> getContentTypes(Request request)
Get the content type's- Parameters:
request- The request- Returns:
- the content type's
-
_getAvailableContentTypes
private Collection<String> _getAvailableContentTypes(Request request)
-
_getAllContentTypes
private Set<String> _getAllContentTypes()
-
_saxContentTypeCriteria
private void _saxContentTypeCriteria(Request request) throws SAXException
- Throws:
SAXException
-
_saxTagsCriteria
private void _saxTagsCriteria(String siteName) throws SAXException
- Throws:
SAXException
-
_saxTag
private void _saxTag(Tag tag, boolean recursive) throws SAXException
- Throws:
SAXException
-
_saxSitemapCriteria
private void _saxSitemapCriteria() throws SAXException
- Throws:
SAXException
-
getContentTypeFilterValue
protected String getContentTypeFilterValue(Request request)
Get the content type's filter value- Parameters:
request- The request- Returns:
- the content type's filter value
-
addTextFieldQuery
protected void addTextFieldQuery(Collection<Query> queries, String language, Request request)
Add the text field query- Parameters:
queries- the querieslanguage- the languagerequest- the request
-
getContentResourcesOrAttachmentQueries
protected List<Query> getContentResourcesOrAttachmentQueries(Query subQuery)
Get the queries for content's attachments and resources- Parameters:
subQuery- the query for attachments and resources- Returns:
- the join query for content's attachments and resources
-
getPageResourcesOrAttachmentQueries
protected List<Query> getPageResourcesOrAttachmentQueries(Query subQuery)
Get the queries for page's attachments and resources- Parameters:
subQuery- the query for attachments and resources- Returns:
- the join query for content's attachments and resources
-
_buildSubQuery
private String _buildSubQuery(Query subQuery) throws QuerySyntaxException
- Throws:
QuerySyntaxException
-
_escapeQueryCharsButNotQuotes
private String _escapeQueryCharsButNotQuotes(String text)
-
addAttributeQuery
protected void addAttributeQuery(Collection<Query> queries, String language, Request request) throws IllegalArgumentException
Add query for each attribute- Parameters:
queries- The list of querylanguage- The langrequest- The request- Throws:
IllegalArgumentException- If an error occurred
-
_getStringAttributeQuery
protected Query _getStringAttributeQuery(String language, String attributePath, String value, ModelItem modelItem)
Get query from string attribute- Parameters:
language- the languageattributePath- the attribute pathvalue- the valuemodelItem- the model item- Returns:
- the query
-
_escapedTextForSearch
private String _escapedTextForSearch(String value)
-
addAllWordsTextFieldQuery
protected void addAllWordsTextFieldQuery(Collection<Query> queries, String language, Request request)
Add content query for "all words"- Parameters:
queries- The querieslanguage- The current languagerequest- the request
-
addExactWordingTextFieldQuery
protected void addExactWordingTextFieldQuery(Collection<Query> queries, String language, Request request)
Add content query for exact wording or phrase- Parameters:
queries- The querieslanguage- The current languagerequest- the request
-
addNoWordsTextFieldQuery
protected void addNoWordsTextFieldQuery(Collection<Query> queries, String language, Request request)
Add content query for "none of these words"- Parameters:
queries- The querieslanguage- The current languagerequest- the request
-
addContentTypeQuery
protected void addContentTypeQuery(Collection<Query> queries, Request request)
Add the content type query- Parameters:
queries- The queriesrequest- The request
-
addTagsQuery
protected void addTagsQuery(Collection<Query> queries, Request request)
Add the tags query- Parameters:
queries- The queriesrequest- The request
-
addPagesQuery
protected void addPagesQuery(Collection<Query> queries, Request request)
Add the pages query- Parameters:
queries- The queriesrequest- The request
-
addDateQuery
protected void addDateQuery(Collection<Query> queries, Request request)
Add the query on start and end dates- Parameters:
queries- The queriesrequest- The request
-
_getSortedListQueryAdapter
private List<QueryAdapterFOSearch> _getSortedListQueryAdapter()
-
_getModelItemFromContentTypes
private ModelItem _getModelItemFromContentTypes(Collection<String> contentTypeIds, String attributePath)
-
-