S
S
see6132015-03-12 20:32:54
MySQL
see613, 2015-03-12 20:32:54

Kosher ad site database structure?

Good afternoon.
I want to make a bulletin board because I could not find decent scripts in the internet. (maybe someone knows a high-quality script?) Requires search functionality and filters as in irr.ru and avito.ru, that is, each category can have its own fields by which you can filter the search.
The fields can be of various types, respectively: text, select, checkbox, radiobutton with multiple selection, year, date, coordinates and "select depending on another select" (for example, select a city and a list of districts of this city appears, or select a car brand, a list of models of that brand appears).
So far, the database structure looks like this:
f0ee091005.jpg
The field_selectable_value_category table implements a dependency between "dependent selects".
Possible actions with the database on the site:
1) admin panel:
- create/edit/delete an ad
- create/edit/delete a category
- create/edit/delete a field
- display fields of a certain category
- display ads of a certain category
- display a tree of dependent selects
- display a tree of categories
2) personal account : - display ads
with all fields
- create/edit/delete an ad
- display a tree
of categories
- display fields of a certain category
- display a tree of categories
- display ads with all fields
It turns out that in order to filter ads, you need to join ads, categories and filtered fields, which can be 5-10. Moreover, it is necessary at the same time to search for a search phrase in the text of the ad.
One of the ideas - when creating/editing an ad, fill in the additional text_cache field with a phrase consisting of the ad text and a list of fields, for example "ad text; field_1: mercedes, field_2: 2007", and search for this field. This method is also good because if a person enters the search phrase "mercedes 2007", it is logical to display ads with the fields: brand - mercedes, year of creation - 2007, and not just look for this phrase in the text of the ad itself.
In addition, I can’t decide where is the best place to store data, for example, field, category ... tables can be stored in mysql, and the declarations themselves with all their data can be stored in mongodb, then when you need to filter the declarations, you won’t need to join by set fields, but simply select the desired record with all the data. But I'm not sure if mongodb has a full text search comparable to sphinx, elasticsearch or solr, so you may need to include a search engine as well. (can anyone tell me for sure if mongodb has a good full text search?)
In general, tips and corrections are welcome.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
A
asdz, 2015-03-13
@asdz

And where in this structure are the possible values ​​of the properties of lists, flags stored?

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question