Apache Solr : - Apache solr is a fast open-source Java search server.
Solr makes it easy to run a full-featured search server
Recent version -- Solr 8.11.1default port: 8983
You can access your Solr admin panel by typing localhost:8983 in your browser.
Install the solr on the server,
Basic Solr Concepts:- Solr is able to achieve fast search responses because, instead of searching the text directly, it searches an index instead.
Solr is powered by Lucene, a powerful open-source full-text search library,
Limitation of default drupal Search:-
1- default drupal search is for smaller sites only,
2- does’t deal with large content like 10k+,
3- Limited operated
4- SQL is not designed as a searching language,
5- It runs and searches directly on the same databases,
6- RDBMS , is incapable to search well,
Benefits of using apache solr:-
1- index and make searchable really a large amount of data from 10k up to millions,
2- Provide faceted search-based navigation like filter data based on author, date, tags, content type etc…
3-Provide Search autocomplete, Spelling suggestions, and content recommendation,
4- Provide fast search experience,
5- Expose all attributes of the node to search,
6- Place search function on a completely separate server,Install the solr on the server,
Steps to Configure the Solr & Drupal :
Step1- Installed the apache solr if using own server (ignore if using any third part server like acquia search)
Step2- Install Search API Solr module in Drupal 8
Step3 - Configure Apache Solr with the Drupal Search API Solr Module
- Create a core in Apache Solr
- create a Solr server and index in your Drupal website
- create a Search API index
- Also add field for indexing
Step4- Download the config.zip file from the search API UI, and extract & move these files to solr config folder.
Step5- Index the data, It will store the data in the solr
Commands to execute the solr
Some Drupal Modules To work with Solr:
drupal/search_api_solr
apachesolr_entity_jit_index:When create/update entity at that time it index it on the solr.
Apache Solr Views : It provides the views plugins and handlers needed to be able to create a view that fetches its results from Apachesolr index, without hitting the database.
$ sudo service solr stop
$ sudo service solr start
$ sudo service solr status
Some Drupal Modules To work with Solr:
drupal/search_api_solr
apachesolr_entity_jit_index:When create/update entity at that time it index it on the solr.
Apache Solr Views : It provides the views plugins and handlers needed to be able to create a view that fetches its results from Apachesolr index, without hitting the database.
Faceted search with Solr in Drupal 8:
Facet is a module, in Drupal 8, that provides a facility to arrange all the search results as per the category. Basically, it is an arrangement of search results based on categories, content type on indexed terms and content type.
Faceted search provides the search like Amazon, Flipkart and so on as per the category, types and all.
There are various reasons a Facet can be used:
- It provides a drill-down search facility.
- It can be used with default search and Solr as well.
- It shows a number of item count for each category.
- Facet provides a wide range of configurable setting in UI and so on.
Solr supports a range of Faceting:
1. Field faceting - Retrieve the counts for all terms or just the top terms in any given field. The field must be indexed.
2. Range faceting – It can be used on any date field or numeric field that supports range queries. There are some parameters for range Faceting.
3. Interval faceting - It allows users to set variable intervals and count the number of documents that have values within those intervals in the specified field.
4. Query faceting - This faceting returns a number of documents in the current search results that also match the given facet query.
5. Pivot faceting - It allows to break down the values by category and sub-categories.
Comments
Post a Comment