Advanced search and query language. Search engine query language. Examples of query conditions Principles of search engines

Advanced search and query language. Search engine query language. Examples of query conditions Principles of search engines

A query language is a man-made programming language used to make queries in databases and information systems.

In general, such query methods can be classified depending on whether they are used for a database or for information retrieval. The difference is that requests to such services are made to obtain factual answers to the questions posed, while the search engine tries to find documents containing information related to the user's area of ​​interest.

Database

Database query languages ​​include the following examples:

  • QL - object-oriented, refers to the successor of Datalog.
  • Contextual Query Language (CQL) is a formal query representation language for information retrieval systems (such as web indexes or bibliographic catalogues).
  • CQLF (CODYASYL) - for CODASYL-TYPE databases.
  • Concept Oriented Query Language (COQL) - used in related models (com). It is based on construpt data modeling principles and uses operations such as projection and de-projection of multivariate analysis, analytical operations and inference.
  • DMX - used for models
  • Datalog is a deductive database query language.
  • Gellish English is a language that can be used to query Gellish English databases and allows for dialogue (queries and responses) and also serves for knowledge information modeling.
  • HTSQL - translates http requests to SQL.
  • ISBL - used for PRTV (one of the first relational database management systems).
  • LDAP is a query and directory services protocol that runs over TCP/IP.
  • MDX - required for OLAP databases.

Search engines

The search query language, in turn, is aimed at finding data in search engines. It differs in that queries often contain plain text or hypertext with additional syntax (such as “and”/“or”). It differs significantly from standard similar languages, which are governed by strict command syntax rules or contain positional parameters.

How are search queries classified?

There are three broad categories that cover most search queries: informational, navigational, and transactional. Although this classification has not been theoretically established, it has been empirically confirmed by the presence of actual queries in search engines.

Information queries are those that cover broad topics (such as a specific city or truck model) that can return thousands of relevant results.

Navigational queries are queries that search for a single site or web page on a specific topic (for example, YouTube).

Transactional - reflect the user's intention to perform a certain action, for example, purchase a car or book a ticket.

Search engines often support a fourth type of query, which is much less commonly used. These are so-called connection requests, containing a report on the connectivity of the indexed web graph (the number of links to a particular URL, or how many pages are indexed from a particular domain).

How is information searched?

Interesting characteristics regarding web search have become known:

The average search query length was 2.4 words.

  • About half of users made one request, and just under a third of users made three or more unique requests back to back.
  • Almost half of users only viewed the first one or two pages of results.
  • Less than 5% of users use advanced search capabilities (for example, selecting specific categories or searching in search).

Features of custom actions

The study also found that 19% of queries contained a geographic term (e.g., names, zip codes, geographic features, etc.). It is also worth noting that in addition to short queries (that is, with several terms), there were often predictable patterns in which users changed their search phrases.

It was also found that 33% of requests from the same user are repeated, and in 87% of cases the user will click on the same result. This suggests that many users use repeat queries to revise or re-find information.

Frequency distributions of requests

In addition, experts confirmed that the frequency distributions of queries correspond to a power law. That is, a small part of the keywords are observed in the largest list of queries (for example, more than 100 million), and they are the most frequently used. The remaining phrases within the same topics are used less frequently and more individually. This phenomenon is called the Pareto principle (or the "80-20 rule"), and it has allowed search engines to use optimization techniques such as indexing or database partitioning, caching and preloading, and has also made it possible to improve the search engine's query language.

In recent years, it has been found that the average length of queries has been steadily increasing over time. Thus, the average request in English has become longer. To this end, Google introduced an update called "Hummingbird" (in August 2013), which is capable of processing long search phrases with non-protocol, "colloquial" query language (like "where's the nearest coffee shop?").

For longer requests, their processing is used - they are divided into phrases formulated in standard language, and responses to different parts are displayed separately.

Structured queries

Search engines that support both syntax use more advanced query languages. A user searching for documents covering multiple topics or facets can describe each of them by the logical characteristic of the word. At its core, a logical query language is a collection of certain phrases and punctuation marks.

What is advanced search?

The query language of Yandex and Google is capable of performing a more narrowly targeted search if certain conditions are met. Advanced search can search by part of the page title or title prefix, as well as specific categories and lists of names. It can also limit searches to pages that contain certain words in the title or are in certain topic groups. When used correctly, the query language can process parameters that are orders of magnitude more complex than the superficial results of most search engines, including user-specified words with variable endings and similar spellings. When you present advanced search results, a link to the relevant sections of the page will be displayed.

It is also possible to search for all pages containing a specific phrase, while with a standard query, search engines cannot stop at any discussion page. In many cases, the query language can lead to any page located in the noindex tags.

In some cases, a correctly formed query allows you to find information containing a number of special characters and letters of other alphabets (Chinese characters, for example).

How are query language characters read?

Upper and lower case, as well as some (umlauts and accents) are not taken into account in the search. For example, a search for the keyword Citroen will not find pages containing the word "Citroen". But some ligatures correspond to individual letters. For example, a search for "aeroskobing" will easily find pages containing "Ereskobing" (AE = Æ).

Many non-alphanumeric characters are constantly ignored. For example, it is impossible to find information for a query containing the string |L| (a letter between two vertical bars), although this character is used in some conversion patterns. The results will only contain data from “LT”. Some characters and phrases are treated differently: a query for "credit (Finance)" will display entries with the words "credit" and "finance", ignoring the parentheses, even if there is an entry with the exact name "credit (Finance)".

There are many functions that can be used using a query language.

Syntax

The query language of Yandex and Google may use some punctuation marks to refine the search. An example is the curly braces - ((search)). The phrase contained in them will be searched in its entirety, without changes.

The phrase in allows you to determine the search object. For example, a word in quotation marks will be recognized as being used in a figurative sense or as a fictional character, without quotation marks as information of a more documentary nature.

Additionally, all major search engines support the "-" character for logical "not" and also and/or. The exception is terms that cannot be prefixed with a hyphen or dash.

Inexact search phrase matches are marked with ~. For example, if you don't remember the exact wording of a term or name, you can enter it in the search bar with the specified symbol and you will be able to get results that are as similar as possible.

Custom Search Options

There are also search parameters such as intitle and incategory. They are filters displayed separated by a colon, in the form "filter: query string". The query string can contain the term or phrase you are searching for, or part or the entire page title.

The “intitle: query” feature gives priority in search results based on the title, but also shows organic results based on the content of the title. Several of these filters can be used simultaneously. How to use this opportunity?

A query like “intitle: airport name” will return all articles containing the name of the airport in the title. If you formulate it as “parking intitle: airport name,” then you will get articles with the name of the airport in the title and mentioning parking in the text.

Search using the “incategory: Category” filter works on the principle of initially displaying articles belonging to a specific group or list of pages. For example, a search query like “Temples incategory: History” will return results on the topic of the history of temples. This function can also be used as an advanced function by specifying various parameters.

Using query conditions, you can find specific items in your Access database. If an item matches all the criteria you entered, it will appear in the query results.

To add a condition to an Access query, open the query in the designer. Then identify the fields (columns) that this condition applies to. If the required field is not on the request form, double-click to add it. Then in the line Conditions enter a condition for it. For more information, see the article Understanding queries.

A query condition is an expression that Access compares to the values ​​in the query fields to determine whether records that contain a particular value should be included in the result. For example, = "Voronezh" is an expression that Access compares to the values ​​in the query text field. If the value of this field in a particular record is "Voronezh", Access includes it in the query results.

Let's look at some examples of commonly used conditions that you can use to create your own. Examples are grouped by data type.

In this section

Understanding Request Conditions

A condition is similar to a formula - it is a string that can include references to fields, operators, and constants. In Access, query conditions are also called expressions.

The following table shows example conditions and describes how they work.

Conditions

Description

>25 and<50

This condition applies to a numeric field such as Price or UnitsInStock. It allows you to display only those records in which the "Price" or "UnitsInStock" field contains value greater than 25 and less than 50.

DateDiff("yyyy", [BirthDate], Date()) > 30

This condition applies to a Date/Time field such as BirthDate. The query results include only records in which number of years betweendate of birthperson and current date is greater than 30.

This condition can be applied to fields of any type to display records where field value is NULL.

As you can see, the conditions can vary significantly depending on the type of data in the field they apply to and your requirements. Some conditions are simple and involve only basic operators and constants. Other conditions are complex: they contain functions, special operators, and field references.

This article lists several commonly used conditions for various data types. If the examples do not meet your needs, you may need to set your own conditions. To do this, you must first become familiar with the complete list of functions, operators, and special characters, as well as the syntax of expressions that refer to fields and literals.

Let's find out where and how you can add conditions. To add conditions to a query, you need to open it in the Designer. Next, you need to identify the fields for which you want to set conditions. If the field is not already on the query form, add it by dragging it from the query designer window onto the field grid or by double-clicking the field (which automatically adds the field to the next empty column in the grid). Finally, enter the conditions in the line Conditions.

Conditions set for different fields in a row Conditions, are combined using the AND operator. In other words, the conditions specified in the "City" and "Date of Birth" fields are interpreted as follows:

City = "Voronezh" AND Date of Birth < DateAdd (" yyyy ", -40, Date())

1. The "City" and "Date of Birth" fields include conditions.

2. This condition is met only by records in which the “City” field has the value “Voronezh”.

3. Only records of people who are at least 40 years old meet this condition.

4. Only those records that meet both conditions will be included in the result.

What if you only want one of these conditions to be true? In other words, how can alternative conditions be introduced?

If you have alternative conditions, that is, two sets of independent conditions of which only one must be satisfied, use strings Selection condition And Or on the form.

1. 1. The “City” condition is indicated in the “Selection condition” line.

2. 2. The “Date of Birth” condition is indicated in the “or” line.

Conditions specified in lines Selection condition And or, are combined using the OR operator as shown below.

City = "Chicago" OR Date of Birth< DateAdd("гггг", -40, Date())

If you need to specify multiple alternative conditions, use the lines below the line or.

Before you start looking at the examples, please note the following:

Conditions for text fields, memo fields, and hyperlink fields

Note: Starting with Access 2013, text fields are called Short text, and Memo fields - Long text.

The following examples are for the CountryRegion field, which is based on a table that stores contact information. The condition is specified in the line Selection condition fields on the form.

The condition specified for the Hyperlink field defaults to the display text that is specified in the field. To set conditions for the final URL, use the expression HyperlinkPart. It has the following syntax: HyperlinkPart([Table1].[Field1],1) = "http://www.microsoft.com/" where "Table1" is the name of the table containing the hyperlink field, "Field1" is the hyperlink field itself, and "http://www.microsoft.com" is the URL you want to find.

Use this condition

Result request

Exactly matches a specific value, such as "China"

Returns records where the CountryRegion field contains the value China.

Does not match a specific value, such as "Mexico"

Not "Mexico"

Returns records where the CountryRegion field value is not Mexico.

Begins with a given string of characters, for example "C"

Returns records of all countries or regions whose names begin with the letter "C", such as Slovakia and the United States.

Note: Star symbol ( * ) in an expression stands for any string of characters. It is also called a wildcard. For a list of these characters, see the article Wildcard reference in Access.

Does not start with a given character string, such as "C"

Returns records of all countries or regions that do not begin with the letter "C".

Like "*Korea*"

Returns records of all countries or regions whose names contain the string "Korea".

Not Like "*Korea*"

Returns records of all countries or regions whose names do not contain the string "Korea".

End with a given string, such as "ina"

Returns records of all countries or regions whose names end with "ina", such as "Ukraine" and "Argentina".

Does not end with a given string, such as "ina"

Not Like "*ina"

Returns records of all countries or regions whose names do not end with "ina", as in the names "Ukraine" and "Argentina".

Returns records where this field does not contain a value.

Returns records where this field contains a value.

"" (straight quotes)

Returns records where the field has an empty value (but not a NULL value). For example, sales records to another department might contain a blank value in the CountryRegion field.

Returns records where the CountryRegion field has a non-empty value.

Contains null values ​​or empty strings

Returns records where the field has no value or is empty.

Non-zero and non-empty

Is Not Null And Not ""

Returns records where the CountryRegion field has a non-null value.

When sorting alphabetically, follow a specific value, such as "Mexico"

>= "Mexico"

Returns entries with the names of countries and regions, starting with Mexico and ending in the alphabet.

Are included in a certain range, for example from A to G

Returns countries and regions whose names begin with the letters "A" through "G".

Matches one of two values, for example "Slovakia" or "USA"

"Slovakia" Or "USA"

Returns entries for the US and Slovakia.

In("France", "China", "Germany", "Japan")

Returns records from all countries or regions specified in the list.

Right([CountryRegion], 1) = "a"

Returns records of all countries or regions whose names end with the letter "a".

Fit to specified length

Len([CountryRegion]) > 10

Returns records of countries or regions whose names are longer than 10 characters.

Match a given pattern

Returns records of countries or regions whose names are five characters long and begin with "Liv", such as Libya and Lebanon.

Note: Symbols ? And _ in an expression represent one character. These are also called wildcards. Sign _ ? * _ % .

Conditions for numeric, currency, and counter fields

The following examples are for the Unit Price field, which is based on a table that stores product information. The condition is specified in the line Selection condition fields on the request form.

To add entries that...

Use this condition

Query result

Exactly match a specific value, such as 1000

Returns records in which the price per unit of an item is 1000 ₽.

Does not match the value, for example 10,000

Returns records in which the price per unit of an item is not equal to RUB 10,000.

< 1000
<= 1000

Returns records in which the product price is less than 1000 ₽ (<1000). Второе выражение (<=1000) отображает записи, в которых цена не больше 1000 ₽.

>999,99
>=999,99

Returns records in which the product price is greater than 999.99 RUR (>999.99). The second expression displays records whose price is at least RUB 999.99.

Returns records in which the product price is 200 or 250 rubles.

>499.99 and<999,99
or
Between 500 and 1000

Returns records of products with prices ranging from RUB 499.99 to RUB 999.99 (not including these values).

<500 or >1000

Returns records in which the product price is not in the range from 500 to 1000 rubles.

Contains one of the specified values

In(200, 250, 300)

Returns records in which the product price is 200, 250 or 300 rubles.

Returns records of products whose price ends with 4.99, for example 4.99 RUR, 14.99 RUR, 24.99 RUR, etc.

Note: Signs * And % in an expression represent any number of characters. These are also called wildcards. Sign % cannot be used in the same expression with a symbol * , and also with wildcard ? . You can use wildcard % in an expression where there is a wildcard _ .

Returns records that do not have a value entered in the Unit Price field.

Returns records that have a value in the Unit Price field.

Conditions for Date/Time fields

The following examples are for the OrderDate field, which is based on a table that stores order information. The condition is specified in the line Selection condition fields on the request form.

Posts

Use this criterion

Query result

Exactly match the value, for example 02/02/2006

Returns records of transactions that occurred on February 2, 2006. Be sure to include # signs before and after date values ​​so that Access can distinguish date values ​​from text strings.

Does not match a value such as 02/02/2006

Not #02.02.2006#

< #02.02.2006#

To view transactions made on or before a specific date, use the statement <= instead of the operator < .

> #02.02.2006#

To view transactions made on or after a specific date, use the statement >= instead of the operator > .

>#02.02.2006# and<#04.02.2006#

Additionally, to filter by a range of values, including the end values, you can use the operator Between. For example, the expression Between #02.02.2006# and #04.02.2006# is identical to the expression >=#02.02.2006# and<=#04.02.2006#.

<#02.02.2006# or >#04.02.2006#

#02.02.2006# or #03.02.2006#

Contains one of several values

In (#01.02.2006#, #01.03.2006#, #01.04.2006#)

Returns records of transactions that occurred on February 1, 2006, March 1, 2006, or April 1, 2006.

DatePart("m"; [SalesDate]) = 12

Returns records of transactions completed in December of any year.

DatePart("q"; [SalesDate]) = 1

Returns records of transactions completed in the first quarter of any year.

Returns records of transactions completed today. If today's date is 02/02/2006, you will see records with the Order Date field set to 02/02/2006.

Returns records of transactions performed yesterday. If today's date is 02/02/2006, you will see entries for February 1, 2006.

Returns records of transactions that will be executed tomorrow. If today's date is 02/02/2006, you will see entries for February 3, 2006.

DatePart("ww"; [SalesDate]) = DatePart("ww"; Date()) and Year([SalesDate]) = Year(Date())

Returns records of transactions completed during the current week. The week starts on Sunday and ends on Saturday.

Year([SalesDate])* 53 + DatePart("ww"; [SalesDate]) = Year(Date())* 53 + DatePart("ww"; Date()) - 1

Returns records of transactions completed over the past week. The week starts on Sunday and ends on Saturday.

Year([SalesDate])* 53+DatePart("ww"; [SalesDate]) = Year(Date())* 53+DatePart("ww"; Date()) + 1

Returns records of transactions that will occur in the next week. The week starts on Sunday and ends on Saturday.

Between Date() and Date()-6

Returns records of transactions completed in the last 7 days. If today's date is 02/02/2006, you will see records from January 24, 2006 to February 2, 2006.

Year([SalesDate]) = Year(Now()) And Month([SalesDate]) = Month(Now())

Returns records for the current month. If today's date is 02/02/2006, you will see entries for February 2006.

Year([SalesDate])* 12 + DatePart("m"; [SalesDate]) = Year(Date())* 12 + DatePart("m"; Date()) - 1

Returns records for the last month. If today's date is 02/02/2006, you will see entries for January 2006.

Year([SalesDate])* 12 + DatePart("m"; [SalesDate]) = Year(Date())* 12 + DatePart("m"; Date()) + 1

Returns records for the next month. If today's date is 02/02/2006, you will see entries for March 2006.

Between Date() And DateAdd("M", -1, Date())

Sales records for the month. If today's date is 02/02/2006, you will see records from January 2, 2006 to February 2, 2006.

Year([SalesDate]) = Year(Now()) And DatePart("q"; Date()) = DatePart("q"; Now())

Returns records for the current quarter. If today's date is 02/02/2006, you will see records for the first quarter of 2006.

Year([SalesDate])*4+DatePart("q";[SalesDate]) = Year(Date())*4+DatePart("q";Date())- 1

Returns records for the last quarter. If today's date is 02/02/2006, you will see records for the last quarter of 2005.

Year([SalesDate])*4+DatePart("q";[SalesDate]) = Year(Date())*4+DatePart("q";Date())+1

Returns records for the next quarter. If today's date is 02/02/2006, you will see records for the second quarter of 2006.

Year([SalesDate]) = Year(Date())

Returns records for the current year. If today's date is 02/02/2006, you will see entries for 2006.

Year([SalesDate]) = Year(Date()) - 1

Returns records of transactions performed in the past year. If today's date is 02/02/2006, you will see entries for 2005.

Year([SalesDate]) = Year(Date()) + 1

Returns records of transactions that will occur in the next year. If today's date is 02/02/2006, you will see entries for 2007.

Year([SalesDate]) = Year(Date()) and Month([SalesDate])<= Month(Date()) and Day([ДатаПродажи]) <= Day (Date())

Returns records of transactions that occurred between January 1 of the current year and today's date. If today's date is 02/02/2006, you will see records from January 1, 2006 to February 2, 2006.

Returns records of transactions completed up to today.

Returns records of transactions that will occur after today.

Filter for empty (or missing) values

Returns records that do not have a transaction date specified.

Filter for non-blank values

Returns records that contain the transaction date.

Conditions for Yes/No fields

As an example, the Customers table has a Boolean field called Activity that shows the current activity of a customer account. The table displays how the values ​​entered in the Boolean field's condition line are calculated.

Field value

Result

"Yes", "True", 1 or -1

Checked for Yes. Once entered, the value 1 or -1 changes to True in the condition bar.

"No", "False" or 0

Checked for value "No". Once entered, the value 0 changes to False in the condition bar.

No value (null)

Not verified

Any number other than 1, -1 or 0

No results if this is the only condition value in the field

Any string of characters other than "Yes", "No", "True" or "False"

The request could not be completed due to a data type mismatch error.

Conditions for other fields

Attachments. In line Selection condition enter Is Null to include posts that do not contain attachments. Enter Is Not Null to include posts with attachments.

Substitution fields. There are two types of lookup fields: those that substitute values ​​from an existing data source (using a foreign key) and those that are based on a list of values ​​specified when they were created.

Lookup fields that are based on a list of values ​​have a text data type and accept the same conditions as other text fields.

The conditions that can be used in a lookup field that is based on values ​​from an existing data source depend on the data type of the foreign key, not the type of data being looked up. For example, you might have a lookup field that displays an employee's name, but uses a foreign key with a numeric data type. Because the field stores a number and not text, you can use conditions that are appropriate for numbers, such as >2 .

If you don't know the foreign key's data type, you can view the source table in the Designer to determine it. For this:

    Find the original table in navigation areas.

    Open a table in the Designer by doing one of the following:

    • Click the table and press the keys CTRL+ENTER.

      Right-click the table and select Constructor.

    The data type for each field is indicated in the column Data type on the table form.

Multi-valued fields. Data in multi-valued fields is stored as hidden table rows that Access creates and populates to represent the field. In the Query Builder they are presented in list of fields using an expandable field. To set conditions for a multi-valued field, you must specify them for one row of the hidden table. For this:

    Create a query that contains a multi-valued field and open it in the Designer.

    Expand a multi-value field by clicking the plus symbol ( + ) next to him. If the field is already expanded, then a minus sign ( - ). Below the field name, you will see a field that represents a single value for a multi-valued field. This field will have the same name as the multi-valued field, but will have the string appended to it .Meaning.

    Drag a multi-value field and its value field into different columns on the form. If you want only the full multi-valued field to be displayed in the results, uncheck the box Show for a single value field.

    Enter in the field Selection condition for a single-value field, conditions that are appropriate for the data type that the values ​​represent.

    Each value in a multi-valued field will be evaluated individually based on the specified conditions. For example, let's say that a multi-valued field stores a list of numbers. If you specify the conditions >5 AND<3 , all records that have at least one value greater than 5 will be displayed And one value less than 3.

>>Informatics: Methods of searching the Internet

§ 5. Internet search methods

Main topics of the paragraph:

♦ three ways to search the Internet;
♦ search servers;
♦ search engine query language.

Three ways to search the Internet

Search engine query language

A group of keywords formed according to certain rules - using a query language - is called a request to the search server. The query languages ​​for different search servers are very similar. You can find out more about this by visiting the “Help” section of the desired search server. Let's look at the rules for forming queries using the Yandex search engine as an example.

Operator syntax
What does the operator mean?
Example request
space or &
Logical AND (within a sentence)
physiotherapy
&&
Logical AND (within document)recipes && (processed cheese)
|
Logical OR
photo | photography | snapshot | photographic image
+
Mandatory presence of the word in the found document
+to be or +not to be
()
Grouping words
(technology | production) (cheese | cottage cheese)
~
Binary operator AND NOT (within a sentence)
banks ~ law
~~
or
-
Binary AND NOT operator (within document)
Paris guide ~~ (agency | tour)
/(n m)
Distance in words (minus (-) - back, plus (+) - forward)suppliers /2 coffee
music /(-2 4) education
vacancies - /+1 students
“ ”
Search for a phrase
"Little Red Riding Hood"
Equivalent: red
/+1 hat
&&/(n m)
Distance in sentences
(minus (-) - back,
plus (+) - forward)
bank && /1 taxes

To get the best search results, you need to remember a few simple rules:

Lesson content lesson notes supporting frame lesson presentation acceleration methods interactive technologies Practice tasks and exercises self-test workshops, trainings, cases, quests homework discussion questions rhetorical questions from students Illustrations audio, video clips and multimedia photographs, pictures, graphics, tables, diagrams, humor, anecdotes, jokes, comics, parables, sayings, crosswords, quotes Add-ons abstracts articles tricks for the curious cribs textbooks basic and additional dictionary of terms other Improving textbooks and lessonscorrecting errors in the textbook updating a fragment in a textbook, elements of innovation in the lesson, replacing outdated knowledge with new ones Only for teachers perfect lessons calendar plan for the year

The problem with searching the World Wide Web is not that there is little information, but that there is a lot of it. Searching for information on the Internet is the cornerstone of effective online work. Possession of search skills makes the Internet useful for the user both during work and during leisure.
To organize searches on the Internet, there are specialized services called search engines.

Search engines.

Search engines are software and hardware systems with a web interface that provide the ability to search for information on the Internet.
Most search engines search for information on World Wide Web sites, but there are also systems that can search for files on FTP servers, products in online stores, and information in Usenet newsgroups. To search for information using a search engine, the user formulates a search query. At the user's request, the search engine generates a search results page. Such search results can combine different types of files, for example: web pages, images, audio files. Some search engines also retrieve data from databases and resource directories on the Internet.
The purpose of a search engine is to find documents that contain either keywords or words that are somehow related to keywords. The search engine is better the more documents it returns that are relevant to the user's query. Search results may become worse due to the nature of the algorithms. For example, when asked for pets, the Yandex search server (see more about it below) provides more than 14,000,000 links to pages containing the information it thinks it needs. However, not everything is so smooth: when you visit some of the pages found, it turns out that the information you are looking for is not enough, or even nonexistent.
To search with maximum effectiveness, you need to know how search servers work and correctly formulate a request to search for information.

How search engines work

Search engines work by storing information about many web pages, which they retrieve from HTML pages. The main components of a search system: search robot, indexer, search engine. Typically systems work in stages. First, the search robot receives the content, then it views the content of websites. Only then does the indexer generate a searchable index. An indexer is a module that analyzes a page, having previously broken it into parts, using its own lexical and morphological algorithms.
The work of most modern search engines is based on the citation index, which is calculated by the indexer as a result of analyzing links to the current page from other Internet pages. The more of them, the higher the citation index of the analyzed page, the higher this page will be displayed in the search results and the higher the page will be presented in the list of found resources.

Rules for constructing search queries

As already noted, there are many search servers on the Internet, domestic and foreign.
Russian search servers: Yandex (www.yandex.ru); Rambler (www.rambler.ru); Aport (www.aport.ru) and Gogo (www.gogo.ru).

Foreign search servers: Google ( www.google.com); Altavista (www.altavista.com) and Yahoo! (www.yahoo.com).
For searching in Russian, Russian servers are better suited; for foreign ones, foreign servers are better suited, although Google does a good job of searching in many languages. Despite the claims of many search engine owners that queries can be written practically in the language that people use to communicate with each other, this is far from the case. Thanks to the introduction of new language technologies, search engines have become much better able to understand the user. Search engines now look not only for the requested word, but also for its word forms, which makes the search results more accurate. For example, if the search query contains the word smart, then its results will contain not only this word, but also its derivatives: smart, smart, as well as intelligence and even intelligence. Naturally, pages with word forms will not be among the first search results, but elements of artificial intelligence are evident. It is useful to take this fact into account when constructing search queries.
It should be remembered that search engines do not take into account the case of characters when processing a request, and it is not at all necessary to use punctuation marks in search queries, since they are also ignored by search servers. However, when constructing complex advanced queries, the search results for which are usually much closer to expected, traditional punctuation is used. Most search engines can handle typos. If the search server thinks that there is a mistake or typo in a word, it will warn you about it with the same phrase: Perhaps you were looking for….

Words to query the search server

There is an expression “A machine must work, a person must think,” and it is said about just such a situation. The user's task when composing a search query is to highlight keywords, the search server's task is to process the entered query in the best possible way. Let's consider an example illustrating typical mistakes of novice users when searching the Internet. The search engine did not return any useful results for the query “Riddles about musical instruments.” Then the user decides to correct the query by adding to it and writing: “Riddles for children about musical instruments” - the search results turned out to be even worse than the previous one. For this example, a good solution was to search for the keyword “riddles.” There are many such sites on the Internet, and by going to the site itself and searching a little through its sections, you can easily find the information you are interested in. Let's formulate a few rules for writing queries:

  • choose only the most important keywords related to the topic under consideration;
  • there should not be too many words, but not too few;
  • If the search results are unsatisfactory, use “softer” conditions for the request or try searching in another search engine, because The mechanisms of search engines are not the same, therefore, the results may also vary.

Advanced Search

To enable more efficient searches on the Internet, search engines provide advanced search capabilities as well as searches using query language. Advanced search - the ability to search using many different parameters. For this purpose, search engines provide separate pages on which you can set such parameters. The principles of advanced search are similar for most search engines.
Let's consider additional search options using the examples of search engines Yandex and Google because Yandex is the most popular search server on the Russian-language Internet, and Google is the most popular search engine in the world. When searching the Internet, Yandex was one of the first to take into account the morphology of the Russian language, that is, to use different forms of the word, as discussed above. By going to the website www.yandex.ru, the user can enter a query and immediately receive search results, or you can use the Advanced search link using the icon and go to the corresponding page (see the figure below), where you can fine-tune the search parameters.

Yandex advanced search page

Let's consider additional features that can be used on the advanced search page: indicate your own location (Moscow), indicate in what form the information should be presented (File Type), the time period in which we are looking for information (per day, per 2 weeks, per month, From ..Before), in what language the information should be presented (Russian, English More), and you can also specify the URL of the site, etc.
The choice (Exactly as in the query) is indicated to the search engine so that the morphology of the query words does not change, but searches only for the form of the word that is specified.

Query language

Query language is a command system that allows you to change query parameters from the main search string using special commands. Aimed at experienced users.
Since the query language is quite complex and voluminous, we will present only its main structures that may be most in demand by users. Some commands of the Yandex query language are presented in the table.

Operator

Description

Syntax

Example request

Search for documents that necessarily contain a highlighted word.

It is acceptable to use multiple + operators in one query.

"word 1 +word 2"

Documents will be found that necessarily contain the words “boulevard” and “Moscow” and may contain the word “Sholokhov”.

Search by citation.

Search for documents containing query words in a given sequence and form.

"word 1 word 2 ... word N"

Documents containing this quote will be found.

Search by quotation with missing word(s).

One * operator matches one missing word.

Attention! Can only be used as part of the operator.

"word 1 * word 2 ... word N "

The operator is separated by spaces.

Documents containing the given quotation, including the missing word, will be found.

Documents containing the given quotation, including missing words, will be found.

The full structure of the Yandex query language can be found on the Help page (http://help.yandex.ru/search/?id=481939). The language of search queries in Google differs from Yandex, although there are some common points. Consider some of the basic commands of this language by studying the table (see below)

The full structure of Google's query language can be found on the Help page:

The queries that we studied earlier are called query-selections. When they are saved in the machine's memory, only the specified search conditions are saved. Every time you run a request for execution, a so-called dynamic data set. He doesn't really exist.

Change request is a query that makes changes to multiple records in one operation. There are four types of change requests: to delete, to update, to add records, and to create a table.

Removal request used to automatically delete a group of records that meet certain conditions from one or more tables. Moreover, you can only delete the entire record, and not individual fields within it.

The operation of deleting records cannot be undone, so it is recommended to create a backup copy of the table before performing it.

Sequencing:

1. In query designer mode, enter the “Query” menu and select the “Delete” command. An additional “Delete” line will appear.

2. In the “Selection condition” line, indicate which records should be deleted.

Neither Figure 4.22 shows the designer window, in which those who have passed the exams for two will be excluded from the students receiving the scholarship. Please note that in the version that we have implemented, students who received bad marks in three exams are deprived of scholarships, if we moved the conditions for passing two in English to one line below (the “or” line), and a bad mark in mathematics would be written even lower, this would mean searching for students who received a bad mark on at least one exam.

Request to update records. Makes general changes to a group of records that are selected using conditions in one or more tables. This type of query allows you to change data in existing tables.

Let's say that initially students were awarded a scholarship in the amount of 34 rubles. (Fig. 4.23). Then they decided to increase the scholarship by 50 rubles. This can be done using an update request. To create an update request, in the Query Builder mode, select the “Query” / “Update” menu command. A new line “Update” will appear at the bottom of the form, into which you should enter an expression for the calculation (Fig. 4.24).

Rice. 4.22. Delete Request Designer Window

Rice. 4.23. Source data table

Rice. 4.24. Update Request Designer Window

When you run a run request, a message appears that you must confirm. After you confirm updating the records, the appearance of the screen will not change; all changes occur only with the table. To view them, open the table. The values ​​in the “Scholarship” field should increase.

Update queries allow you to make changes not only to all table records, but also to individual records that are found based on certain conditions. In this case, in the “Selection condition” line, conditions are entered that determine which records to select for change, and in the “Update” line they indicate how they should be changed.

After passing the exam, the dean's office decided to deprive all students of their scholarships who received at least one bad mark in the session. A request was made and... It should be noted that the printed 0 in the “Update” line means that the scholarship will be equal to 0, but not in all records, but in those that satisfy the conditions given in the adjacent column (Fig. 4.25).

Rice. 4.25. Update Request Designer Window

Conditions are combined with the word OR (or VT=2, or Mathematics=2, or English=2).

Let’s add a new field “Dormitry” to the table, but we won’t fill it in manually, leaving it empty. Let's determine who needs a dormitory, considering that if a student lives in Donetsk, a dormitory is not required, but if living in other cities, it is required (Fig. 4.26).

Let's launch the execution request by clicking on the button, and then open the table. For clarity purposes, all columns are hidden except the “Last Name” and “Dormitry” columns (Fig. 4.27).

As you can see, the update request is very convenient, allowing you to automatically change outdated information to new information, change the contents of tables according to certain conditions.

Rice. 4.26. Update Request Designer Window

Rice. 4.27. Result of the update request

By using add request tables, you can add records from one table to the end of the table you specify or several tables. creates a new table based on all or part of the data from one or more tables.

Let's say you want to create two tables based on an existing one, but transfer information about students who need a dormitory into the first table, and information about students living in Donetsk into the second table. This operation is performed using a table creation query (Figure 4.28).

For this:

~ transfer to the query those fields that should be in the table;

~ indicate the selection conditions;

~ enter the “Query” / “Table Creation” menu, in the window that appears, enter the name of the table to be created, in our case it is called “Nonresident”;

~ Start the execution request. Agree to create a new table;

The table will appear in the list of existing tables .


Rice. 4.28. Table Creation Query Design Window



Other news

views