Search

From ZekrWiki

Jump to: navigation, search
Fuzzy search on Vista (persian)
Fuzzy search on Vista (persian)

Zekr supports two methods of search: Basic and Advanced, both are capable of sorting results by Relevance, Natural order, Revelation order and Aya length. You can also limit search results by setting search scopes using small arrow button near search button.

Contents

Basic Search

Zekr Basic search (although not so basic, but called basic for some historical background) uses Tanzil's search method, that is to create a regular expression from the user's input query. By default, it places a hidden AND operator between separate words of a query (contrary to Advanced Search). It supports Partial diacritic matching, Partial phrase matching, Exact phrase matching, logical NOT (-), logical OR (|), and wildcards (* for zero or more letters, ? for zero or one letter, and . for exactly one letter).

The following documentation is taken from Tanzil Search Tips:

Basics of search

  • Partial diacritics
You can refine your search by adding some diacritics to the search word. For example, the search word مخلِص matches مُخْلِصِين but not مُخْلَصِين.
  • Automatic and
By default, Tanzil returns ayas that include all of the search terms. For example, the search phrase كتاب قرآن will return ayas that contain both كتاب and قرآن (in any order).
  • Exact phrase
To search for an exact phrase, enclose the phrase in quotation marks, like "رسول الله".
  • Whole words
To search for a whole word only, put underscores around the search word. For example, _كتاب_ matches كتاب, but not الكتاب and كتابهم. (You can restrict your search word only from one side. For example, _حُب matches all words that end with حُب.)
  • Similar letters
Tanzil automatically matches similar letters. For example, the search word نعمت matches both نعمت and نعمة.

Operators

  • Logical not: -
If you want to exclude some words in your results, simply put a minus sign in front of the words you want to avoid. For example, the search phrase كتاب -تورات will return ayas that contain كتاب but not تورات.
  • Logical or: |
This operator is used to simultaneously search for more than one word in ayas. For example, the search phrase كتاب|تورات will return ayas that contain either كتاب or تورات, or both.

Wildcards

  • Zero or more letters: *
This wildcard matches any sequence of zero or more letters. For example, the search phrase مس*ون matches words like مسلمون and مستضعفون.
  • Zero or one letter: ?
This wildcard matches zero or one letter. For example, the search phrase مس؟جد matches both مسجد and مساجد.
  • Exactly one letter: .
This wildcard matches exactly one letter. For example, the search phrase ت.ون matches تكون and ترون, but not تعلمون.


Advanced Search

Advanced search; scoped
Advanced search; scoped

Overview

Zekr advanced search (introduced in Zekr 0.6.0) uses Lucene full-text search library. It supports all sorts of queries Lucene has: Wildcards, Range, Boosting, Fuzzy queries, Boolean operators, Grouping, etc.

Advanced search accepts full-text matching only when no wildcard specified, so searching for سلام will not result into السلام. You can use *سلام so that also find ayas with the text السلام within them.

Advanced search is assumed to be faster (lower response time) than Basic search, since it uses indices, although the difference is at the order of some more milliseconds fro Basic search, which is not considerable.

Features

  • Wildcards: * and ?
  • Grouping: using parentheses to make groups of queries
  • Boolean operators: &&, ||, !, +, -, AND, OR, NOT
  • Range search: can be either specified by search scopes (like basic search), or through queries like this: location:[010-011 TO 020-0020], to match from 10:11 to 20:20.
  • Boosting: see Boosting a term
  • Fuzzy search: see Fuzzy searches

Sample query and results

Wildcards

To perform a single character wildcard search use the "?" symbol and for a multiple character wildcard search use the "*" symbol.

  • *دنيا => results in 115 matches in 111 ayas.
  • *آخرة => results in 115 matches in 113 ayas.
  • شهر شهرا *شهر -*اشهر => results in 12 matches in 9 ayas.
  • *امرأت* -*امرات?ن => excludes امرأتين and امرأتان, and results into 24 ayas.
  • يع؟م => results in 73 matches in 73 ayas. This query matches both يعظم and يعلم (question mark means any single character).

Boolean operators

You can use AND, +, OR, NOT and - as Boolean operators. These operators must be all CAPS. OR is the default conjunction operator, so that if you search for هو الذي, it searches for هو OR الذي. || can be used instead of OR, and && instead of AND. Search results should always contain the term preceded with + operator.

Fuzzy search

Fuzzy search uses Levenshtein Distance algorithm to find similar characters up to a similarity measure (a number between 0 to 1).

  • یعلمون~0.7 => results into 187 results in 183 ayas, and matches all the followind similar words: يظلمون, يعلمان, يعلموا, يعلنون, ويعلمون, ويعلمون, ويعلمون, سيعلمون, فيعلمون, ليعلمون, يعلمون, تعلمون.

Scope

  • In order to apply ranges, you can either the arrow button near search button, and select/create a search scope, or add your scope manually to the query. For example this query: الله && location:[001-001 TO 002-015] results into ayas with the word Allah within sura 1, aya 1 to sura 2, aya 15. The result ayas will be: 1:1, 2:1, 2:7, 2:9, 2:10 and 2:15.
Retrieved from "http://zekr.org/wiki/Search"
Personal tools
download