Skip to main content

Apache Solar Search

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.1
default port: 8983
You can access your Solr admin panel by typing localhost:8983 in your browser.

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


 $ 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.

Part 2  

Comments

Popular posts from this blog

How to span column of custom table in Drupal

If you want to span the column of custom drupal table like below image, Follow the below code to make the header of the table , <?php $header = array('S.N','District', array('data' => '<div class ="house">Household </div><br><span>Rural</span> <p>Urban</p>','colspan' => 2), array('data' => '<div class ="house">Members</div> <br><span>Rural</span> <p>Urban</p>','colspan' => 2), 'Duplicate/Failed Registration', array('data' => '<div class ="house">Pending De duplication </div><br><span>Rural</span> <p>Urban</p>','colspan' => 2), 'Non Un-organised Workers', 'SSID Generated', 'No. of Card Personlised', ); $rows[] = arra...

Drupal 8 : Link actions,Link menus,Link Tasks,Routings

Drupal 8 : Link actions,Link menus,Link Tasks,Routings Link actions Local actions have also been moved out of the hook_menu() system in Drupal 8 .Use actions to define local operations such as adding new items to an administrative list (menus, contact categories, etc). Local actions are defined in a YAML format, named after the module they are defined by. Such as menu_ui.links.action.yml for this example from menu_ui module: menu_ui.link_add:   route_name: menu_ui.link_add   title: 'Add link'   appears_on:     - menu_ui.menu_edit Here, menu_ui.link_add: It is the Unique name of the link action Most likely start with module name, route_name : Name of the route it means when click the link it redirect to this route, appears_on :  An array of route names for this action to be display on. Now how to know the Route name of any internal/external admin pages like below, By through the drupal console we achieve it, drupal debug:router...

Cache In Drupal

Drupal 8 core caching modules: The Internal Page Cache module: this caches pages for anonymous users in the database. Pages requested by anonymous users are stored the first time they are requested and then are reused for future visitors. The Internal Dynamic Page Cache module: This is a key feature that Drupal 7 did not have. Unlike the Internal Page module, the Dynamic Page module aims to speed up the site for both anonymous and logged-in users. How Cache Works in Drupal: There are two modules available in the drupal core 1 - Internal page cache: The Internal Page Cache module caches pages for anonymous users in the database. Pages requested by anonymous users are stored the first time they are requested and then are reused. Configuring the internal page cache :   From the performance page we can set the maximum time how long browsers and proxies may cache pages based on the Cache-Control header. 2 - Internal dynamic page cache: Drupal 8 provides the Dynamic Page Cache m...