Answer the question
In order to leave comments, you need to log in
How to organize a database for efficient search?
There is a table tbl_item
in which the main content is stored:
tbl_item
id -> integer primary key
name -> varchar(250) not null
id -> integer primary key
name -> varchar(250) not null
id -> integer primary key
item_id -> integer not null
tag_id -> integer not null
tbl_search
and enter all sections, authors, keywords, etc. into it according to the schedule. and link it to a table tbl_item
. And when searching, look for the desired word in it and return the records associated with it from tbl_item
? Answer the question
In order to leave comments, you need to log in
The most correct answer is Sphinx ( sphinxsearch.com ). A full-fledged search can only be done on a search engine, on the database itself - this is always for show.
And if you decide within the set conditions, then personally I usually created a View with all the necessary data. This will at least free you from "manual" data addition and consistency tracking.
With a good search, something like this is done, only not word forms are entered, but dictionary forms of the word (lexemes) and the places in which they occur (for searching separately by title, by text, by authors ...). This requires a morphological database of the Russian language (for example, according to the Zaliznyak dictionary ). Often, dictionaries of synonyms and the calculation of the proximity of the position of words in the text are also used.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question