Please contact support if you would like to have SOLR enabled for your installation. The SOLR search feature may be enabled per interface (website) or per website project. If you’d like to experiment with it, please create a new project from live in your Website Template Manager and then let us know the name of the project. You will be able to use the SOLR features while in preview mode for this project.
For details on SOLR tokenizers and filters, please see the full SOLR documentation.
SOLR databases are called cores. By default, you’ll have a product core that contains searchable product information. This usually includes fields like product id, part number, name, and description, but can include whatever product data you like. You may also have an optional category core that contains searchable category information. Please note that the category core is not used by the standard web site search feature. If utilized, it must be customized per client.
Once SOLR is enabled, you will have access to a new AJAX target /ajax_targets/solr.php
. This AJAX endpoint will perform one or more search-related commands. To perform a particular command, include the command name in a colon-separated list via the query parameter. For example, issue the following to perform the search
and popular
commands on the term “foo”:
query=search:popular&term=foo
The results will be a JSON encoded array, indexed by the name of the command:
{
"search": [ <search results> ],
"popular": [ <popular results> ]
}
If no query parameter is specified, a search command will be run, with a subsequent spellcheck if the search returns no results.The available commands are:
A search on matching string prefixes. For example, a search for “sola” might return a list of terms like “solar”, “solarium”, “solar-powered.” This is generally used to autocomplete search terms in a search form and is typically populated from the product name field, but is not restricted to it. The database tables fulltext_search_autocomplete
and fulltext_search_autocomplete_fields
determine which fields are used to seed this data.
Parameters:
Name | Required | Value | Description |
term | yes | string | The term to search. |
name | no | string | The name of the autocomplete to use. These are defined in the fulltext_search_autocomplete name field. If not specified, it will default to autocomplete_phrase. |
Example:
/ajax_targets/solr.php?query=autocomplete&name=my_custom_autocompleter&term=foo
Result:
{
"autocomplete": [
"food",
"fool",
"foot" ]
}
A search for the most popular search terms. These are tracked in the
Name | Required | Value | Description |
term | yes | string | The term to search. |
Name | Required | Value | Description |
term | yes | string | The term to search. |
fulltext_search_config
Enhanced Solr search to perform the following:
1. Support requesting Solr search result relevance in detail field list. This field is always allowed, regardless of the listed allowable fields.
2. Previously, you could select detail only if there were less than 11 search results. Now, if there are more than 12, you'll get detail, but only for the first 12.
Name | Required | Value | Description |
term | yes | string | The term to search. |
core | no | string | The core to search in, currently one of "product" or "category". If no specified, defaults to the product core. |
limit | no | integer | Limit the results set to this many items. If not specified, defaults to 1000. |
detail | no | boolean | Include the full product detail, not just the product ID. This parameter will only be honored if the results set is less than or equal to12 items. |
fields | no | string | If detail is specified, this parameter may contain a comma separated list of fields to include in the result. This list must be a subset of the fields specified via the Available Solr AJAX Category Fields and Available Solr AJAX Product Fields settings in the channel_system_settings table. If detail is requested but no fields are specified, all the fields listed in the channel_system_settings table will be returned. |
Name | Value | Description |
Available Solr AJAX Product Fields | string |
A comma-separated list of product fields that will be returned by the AJAX search feature when detail is requested but no product fields are listed. |
Available Solr AJAX Category Fields | string |
A comma-separated list of product fields that will be returned by the AJAX search feature when detail is requested but no category fields are listed. |
Name | Value | Description |
Solr Dictionary Indexer |
string |
The type of indexer to use for creating the Solr spellcheck dictionary. If not specified, defaults to |
Solr Dictionary Source |
string |
The source of data for the Solr spellcheck dictionary. If |
Field | Type | Description |
id |
integer |
Primary key. |
term |
string |
The term that has a synonym. |
synonym |
string |
The synonym for the term. |
Field | Type | Description |
id |
integer |
Primary key. |
interface_id |
integer |
The interface (website) id that this search was performed on. |
terms |
string |
The search term(s) that were used. |
popularity |
integer |
The number of times this search term returned results. A negative value indicates the number of times this search term returned no results, so sort this table by popularity descending to find the most popular searches. |
Field | Type | Description |
id |
integer |
Primary key. |
name |
string |
The name of the autocompleter, to be passed via the |
type |
string |
The SOLR tokenizer to use for the input fields. One of |
count |
integer |
The default number of results to return if not specified via the |
interface_id |
integer |
The interface (website) id that this field applies to. |
Field | Type | Description |
id |
integer |
Primary key. |
autocomplete_id |
integer |
The |
info_field_id |
integer |
The |
Field | Type | Description |
id |
integer |
Primary key. |
interface_id |
integer |
The interface (website) id that this field applies to. |
assoc_entity |
string |
One of Product or Category. |
info_field_id |
integer |
The |
Field | Type | Description |
id |
integer |
Primary key. |
info_field_id |
integer |
The |
type |
text |
The SOLR tokenizer to use for the field. |
indexed |
enum(true,false) |
If true, the field will be indexed and searchable. |
stored |
enum(true,false) |
If true, the field will be returned in the result record of searches. Note it doesn’t make much sense to have both |
boost |
float |
The SOLR boost value to apply to this field. Values are relative and mean nothing inherently, so it is meaningless to give all fields the same boost. Fields without an explicit boost have a value of 1. |
Field | Type | Description |
default_root_category_id |
integer |
The category ID considered the “base” category for this interface. |
© 2023 CORESense · info@coresense.com · 125 High Rock Avenue, Saratoga Springs, NY 12866