Y
Y
yesworld2017-04-21 17:06:29
PHP
yesworld, 2017-04-21 17:06:29

How to change the weight for individual columns in a table?

Good day.
1 question. I have an Articles table where there are id, title, content, publish columns . How can I set certain columns to be prioritized?
And can it be done at all? Let's just say that first the search was by title, then by content.
2 Question. I have multiple tables with indexes. Is it possible to display results first from one indexed table, then from another?

source Articles {
    sql_query_pre = SET NAMES utf8
    sql_query	= SELECT id, title,  content, publish, 1 as model_name FROM Articles
    sql_attr_uint = publish
    sql_attr_uint = model_name
}
source Catalog {
    sql_query_pre = SET NAMES utf8
    sql_query	= SELECT id, title,  content, publish, 2 as model_name FROM Catalog
    sql_attr_uint = publish
    sql_attr_uint = model_name
}
index ArticlesIndex
{
    source              = Articles
    path                = /var/data/sphinxsearch/articles.main
    morphology          = stem_ru, soundex, metaphone
}
index CatalogIndex:ArticlesIndex
{
    source              = Catalog
    path                = /var/data/sphinxsearch/catalog.main
}

Thank you for your attention.

Answer the question

In order to leave comments, you need to log in

1 answer(s)
P
Puma Thailand, 2017-04-22
@opium

Via rank

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question