Using OR (|) in queries

Hi,

Could someone point to me why the following query:
SELECT id FROM index WHERE MATCH ('@tags c sharp|php|mysql|html|css|cplusplus|nginx|apache|');
doesnt return anything, while this query returns results:
SELECT id FROM index WHERE MATCH ('@tags php|mysql|html|c sharp|css|cplusplus|nginx|apache|');

If searching for ‘@tags c sharp’ i get results. The tags field in the db contains words separated by commas.

Thank you!

Thank you!

you could use show plan statement to get info how your query got processed, like

SET profiling=1;
query;
SHOW PLAN;

I cant post the exact query as it contains adult keywords, but what i noticed is that it wont return any results if the keyword contains space, like ‘html|css|hello world|abc def|mysql’. All the keywords are 100% in the database, if i only search for ‘abc def’ it will return results. What i’m trying to do is match ANY of the keywords separated by |.

This is my index:
CREATE TABLE aspro3 (
video_id integer,
total_views integer,
today_views integer,
week_views integer,
month_views integer,
year_views integer,
orientation integer,
mobile integer,
hd integer,
featured integer,
premium integer,
add_time timestamp,
view_time timestamp,
percent float,
percent_today float,
percent_week float,
percent_month float,
percent_year float,
duration float,
ctr float,
ctr_today float,
categories multi,
title text,
description text,
tags text
)

css|hello world will be processed as

(css|hello) world

you need to provide exact grouping as css|(hello world) or css|"hello world"

you also could use HTTP interface as query terms there provide separately as objects in array as described here Manticore Search Manual: Searching > Filters

OR operator precedence is higher than AND and described here Manticore Search Manual: Searching > Full text matching > Operators along with examples similar to your query

Yep, that works. If i use html|“c sharp”|php instead of of html|c sharp|php it works. Thank you!