on ‎2022 Feb 15 4:33 AM
Hi,
There are the same Free Text Query tab on SolrIndexedProperty and SolrSearchQueryProperty.
I know if I put attribute on SolrSearchQueryProperty, the attribute can be searchable and configure on Free Text Query tab.


But if I configure on SolrIndexedProperty, nothing happens.
So what is the purpose function for the Free Text Query tab on SolrIndexedProperty ?
Cheers,
Rafi
Request clarification before answering.
The tab for SolrIndexedProperty is used when there is no SearchQueryTemplate is defined.
In SearchSolrQueryPopulator class SearchQuery is generated with the following method call
final SearchQuery searchQuery = facetSearchService.createFreeTextSearchQueryFromTemplate(facetSearchConfig, indexedType,
queryTemplateName, freeTextSearch);If you navigate createFreeTextSearchQueryFromTemplate method of DefaultFacetSearchService you will see the following codesSearchQueryTemplate queryTemplate = this.findQueryTemplateForName(indexedType, queryTemplateName);
if (queryTemplate != null) {
SearchQuery searchQuery = this.createSearchQuery(facetSearchConfig, indexedType);
// Populating other fields
if (StringUtils.isNotBlank(userQuery)) {
this.populateFreeTextQuery(facetSearchConfig, indexedType, queryTemplate, searchQuery, userQuery);
}
return searchQuery;
} else {
// This is used when no SearchQueryTemplate is defined
return this.createFreeTextSearchQuery(facetSearchConfig, indexedType, userQuery);
}
If you navigate to the createFreeTextSearchQuery method which is used when no template is defined you'll see the followingIf you navigate to the createFreeTextSearchQuery method which is used when no tempalate is defined you'll see the following
public SearchQuery createFreeTextSearchQuery(FacetSearchConfig facetSearchConfig, IndexedType indexedType, String userQuery) {
SearchQuery searchQuery = this.createSearchQuery(facetSearchConfig, indexedType);
// Populating other fields
if (StringUtils.isNotBlank(userQuery)) {
this.populateFreeTextQuery(facetSearchConfig, indexedType, searchQuery, userQuery);
}
return searchQuery;
}
In the method populateFreeTextQuery() there are usages of IndexedProperty's fts fields likeif (indexedProperty.isFtsQuery()) {
searchQuery.addFreeTextQuery(indexedProperty.getName(), indexedProperty.getFtsQueryMinTermLength(), indexedProperty.getFtsQueryBoost());
}
Similarly in the method populateFreeTextQuery() which is used when a SearchQueryTemplate is defined, there are usages of SearchQueryPropety's fts fieldsif (searchQueryProperty.isFtsQuery()) {
searchQuery.addFreeTextQuery(searchQueryProperty.getIndexedProperty(), searchQueryProperty.getFtsQueryMinTermLength(), searchQueryProperty.getFtsQueryBoost());
}
Hope this helps,
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
ahh I see.. already debug that and try to make empty on SearchQueryTemplate, the attributes on SolrIndexedProperty was used for search.
Thank you mansurarisoy for explain the code flow.
Free Text Query
This an exact match search. Only when the exact keyword is found in the solr index, you will get a result. Do note that this does not mean it has to match the entire value. In the case of real test solr considers real and test separate keywords. If you would search for multiple keywords, for example on "real test" solr would search for the keyword "real" and the keyword "test"
Fuzzy queries are used when you allow for mistakes in your searches. This means that you will also match search keywords that have a few wrong characters. The fuzzyness factor determines how much can be wrong for the result to show up. Note that the fuzzy search does not have wildcards. It behaves more like an exact match.
Your case only free text is enabled and not fuzziness. SO word search should work, considering all other things are fine.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi pavankumar_joshi thanks for the answer,
But what I ask here is about the Free Text Query tab section, not the search configuration(free text, fuzzy, wildcar, phrase).
there are the same tab section on SolrIndexedProperty and SolrSearchQueryProperty. but nothing happens if I configure it on SolrIndexedProperty.
| User | Count |
|---|---|
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 | |
| 1 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.