📜 ⬆️ ⬇️

Advanced Yandex (and Google) search using the installed script or in the interface

In Yandex search, as in Google, there are advanced search settings (by dates, documents, sites, country, language, ...) and special pages for advanced search . Both are inconvenient because of the interface - a large number of push buttons, clicks and movements. For some (commonly used) search modes, user scripts are made with the choice of one of dozens of buttons in one click. On the screen, only a few start buttons are visible, working as falling lists on mouseover.

Such a script, once the former without falling lists, has worked for a long time on Google’s pages , and judging by the number of downloads, has gained popularity among English-speaking users (there is a choice of 5 interface languages). Once it was thought that it would be easy to transfer it to Yandex , and on the weekend for a couple of days adaptation and repainting for the Yandex colors was done, and now it seems to be the “target audience” - IT people who sometimes have to search a lot and who usually install additional scripts and walk on git ha bam .


In addition to utilitarian benefits, the script may be interesting as a testing ground for working out interface solutions. A bunch of 2-3 scripts in perspective can start working as a meta-search engine, everything for this is already there, except for the final touches - to put the connecting buttons, port to mailru and other search engines.

Now let's consider what features of Yandex have been added to the previously existing solution for Google.
')
The first and only limitation of Yandex that catches your eye is the lack of search in the last hours . Most likely, Yandex still does not have such functionality, the question on toster.ru did not bring the answer, but now, perhaps, Yandex developers will write something in the comments.

There was also an expansion of functions in the search for documents - the query interface to Yandex allows you to search by a group of document types (multi-select in settings), and Google each time only by one type of document (PDF, DOC, SWF, ...).

As for the rest, the mode of special settings intersects so well that it allowed us to make not only the interface look like, but also the storage of settings parameters. This is a site (domain) search and search for the last time interval (more than a day).

Details of settings storage - solution with external localStorage


Previously, a similar extension for Google has acquired saving search settings. Just because the list of your domains or interface language is sometimes desirable to change, and the changes directly in the script are few, which are familiar only to front-end programmers, and even with fairly frequent updates there is no way to keep the code of a part of the script that was fixed by the user from a general update. If there are stored (in localStorage) settings, then the question is removed.

But then Google found the habit of erasing local memory! Facebook users have come across this before, and to solve this problem there was an article on Habré and a script on another occasion (bookmark bookmark with scrolling window scrolling). Here - similarly, it was required to run from the Google domain somewhere to another domain, where the cleaner scripts do not reach. Communicated with a quiet, modest page on imtqy.com, where everything was safely stored, almost like in a bank. (This link is useful after installing the script to see where the settings have been saved.)

For Yandex, this resulted in the fact that the storage of its settings was also done on the same domain (imtqy.com). This immediately led to the fact that 2 different scripts, different domains and different search engines acquired common settings. No, they are extremely easy to separate, but why? The list of favorite search sites, the interface language, and subsequently - storing the latest date intervals - all this began to appear the same in Google and Yandex, provided that you use the same browser.

It is this mechanism that now makes it very easy to make a meta-search - add a field for commands to saved settings - just the command “search” or “search with settings”, or “search in selected search engines”). In the future, you can fantasize that there will be a synchronous card management, and viewing in sections, for example, news, pictures. Agree, it’s convenient to walk around the map in one window, and in the next one - to have a synchronous copy in Google maps to switch to the window where there is more complete information. And the issuance of pictures will be noticeably different and complementary.


Directory of advanced search options in Yandex and Google


This list may be supplemented by professional users and developers of companies ( supplemented by comments or drugs ).
All methods and types are listed in order to organize a small directory.
Much of the user interface is not implemented. What is implemented is indicated.

In Yandex:



There are a number of other more specific parameters, the query language (for example, negative keywords and the quoted quotes), which will not be considered, but some of them may appear in the interface of the advanced search user script. In addition, Yandex has a number of types of pages (pictures, video, news, Market, etc.) where requests may have features (for example, there is a search by images, a search for a geographical location on the map). The script now covers the main field - text search.

In the Yandex news section , the advanced search follows other parameter names, and the script is not performed in this section at this stage. Google has the same rules for building queries in the news section, the script for Google works in all its main sections.

In Google:


Interestingly, different query parameters give the same results, but in 2 page designs - with a black header (older) and with a white one. The quality of the issue is most likely the same. The Advanced Search page now gives the answer with a black heading, and this is not necessarily true for different countries. (It’s also true that doodles are issued at different times for different time zones.)


Other parameters - Google has a number of other parameters for text search and a query language, a detailed consideration of which is beyond the scope of the article’s article, but they may turn out to be in the future in the user script.


In the issuance of possible sorting by relevance or date.
There are a number of search types (images, videos, news, maps, ...), where the search parameters will be different or with specificity. The Google Search Extra Buttons script saves the type of search page it was started with.

On the topic of organizing a meta-search by the usual requests


(Further plans and fantasies interesting to interface developers will follow.)

In its simplest form, a meta-search is a view of the results in 2 adjacent windows of one browser. Additionally, you can search for identical answers from the second window. If you want to get the issue in one window, you need to decide where in the list to embed the list items from the second window. Most likely, it is convenient to implement at about the same position that the element occupied in the 2nd window. And, of course, to indicate which search engine the answers came from, so that the user has statistics accumulated in the memory, for which queries from which search engine he received a useful answer.

Remark on search engine policy. It is technically impossible to do a meta-search in one window, because modern large search engines strictly monitor that the request is not executed in a frame, so that the answer comes to the real page, and not to an XMLHTTP object. This is due to the income from related advertising, which is now the main bread of any search engine. For the user, on the contrary, the result is important and the maximum is the engine that gives it.

Metasearch on scripts is the probability of the near future. For implementation - script codes are available on GietHab ( Yandex , Google ), new solutions are welcome.

UPD : Who will help make the Belarusian, Kazakh and Turkish localization?
volume and format
ru:{ 'search in PDF files':'   PDF' ,'search in':' ' ,'from / to':' ' ,'last':[' ',' ',' '] ,'day':'' ,'days':['',''] ,'week':'' ,'weeks':['',''] ,'month':'' ,'months':['',''] ,'year':'' ,'years':['',''] ,'hour':'' ,'hours':['',''] ,'Settings':'' ,'of userscript':'' ,'reload page for effect':' ' ,'Interface language':' ' ,'Less positions at the end of selects':'    ' ,'Sites':'' } 

UPD2 2016-01-22: The primary buttons are made as arrows, according to the style of the Yandex button. Screenshots in the article are replaced.

Source: https://habr.com/ru/post/275479/


All Articles