Category: Search Engine – Solr

Solr Installation No ratings yet.

By default, SOLR will ship with Jetty server. In order to install with Jetty, you may need to: Install JRE or JDK from Oracle (at least 1.7), you can download from http://www.oracle.com/technetwork/java/javase/downloads/index.html Setup JAVA_HOME path a. Right-click on “Computer”, and click on “Properties” b. Click on “Change Settings” c. Click on “Environment Variables” d. Under

What is Multi-Values Field? No ratings yet.

In the previous blog, we have created a new collection “films”, and it has several multi-values fields such as directed_by, genre and name. Let’s open the C:/{your_installed_path}/solr-5.4.1/server/solr/films/conf/managed-schema.xml to have a look:   However, these fields have not stated ‘multiValued=”true”’, how do you know they aremulti-values? You can check their field type, for example, genre’s field

What is Dynamic Field? No ratings yet.

If you cannot confirm the fields for your collection initially, or the fields of your data source may change in the future, you can use pre-defined dynamic fields. You can also define some specified for your data source. Let’s check the C:/{your_installed_path}/solr-5.4.1/server/solr/films/conf/managed-schema.xml , you can some pre-defined dynamic fields with tag “<dynamicField>”, such as: <dynamicField

Import Data from Database No ratings yet.

Besides indexing the articles through SOLR Update Request-Handler, you can also import data from database. This example will demonstrate how to import data from MySQL database. Assuming you have MySQL installed, let’s run the below simple schema in order to create a database/table with some records: /* create database */ CREATE DATABASE itblogs DEFAULT CHARACTER

Basic Search No ratings yet.

Please see the below basic SOLR search examples for your reference: Simple Search Requested URL http://localhost:8983/solr/films/select?q=day&row=20&wt=json&indent=true Parameters Values Details q day Text for searching wt json Return results format, it can be json / xml / python / ruby / php / csv row 20 Optional. By default = 10 Returning no of rows  

Auto-Suggestion (Auto-Complete) Box No ratings yet.

For your application, you may have auto-suggest (or call auto-complete) feature in searching field, such as https://jqueryui.com/autocomplete/#remote .   When user enters two or more than two characters, it will trigger auto-complete action, and remote lookup external web API, which returning list of data in JSON format. So, for example, your application can query SOLR

Spell Check Search – Do you mean? No ratings yet.

When users search, he/she may typo-mistake or spell wrong when entering keyword. You can check out Google search engine, it has a feature like below, asking “Did you mean: something else”, when searching with wrongly spell words like “knigs”.   With SOLR, you can also have this feature. Let’s update the C:/{your_installed_path}/solr-5.4.1/server/solr/films/conf/solrconfig.xml from <str name=”field”>text</str>

Faceted Search No ratings yet.

Faceted search is useful to do count(*) feature, please see below examples for your reference: Count(*) by Specified Field When browsing this page : http://localhost:8983/solr/films/browse , you may find Facets field on the left handset as:   With below example, it will return you a list of genres with article counts, so that you can