[ https://issues.apache.org/jira/browse/CASSANDRA-11131?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15136601#comment-15136601 ]
Pavel Yaskevich commented on CASSANDRA-11131: --------------------------------------------- LIKE '<term>%' is a PREFIX mode construct which, as you mentioned, for CONTAINS is the same as LIKE '%<term>%' that's why these two are not intermixed together as it pretty hard to maintain in presence of pluggable analyzers. > [SASI Pre-QA] Allow '<term>%' syntax for CONTAINS mode > ------------------------------------------------------ > > Key: CASSANDRA-11131 > URL: https://issues.apache.org/jira/browse/CASSANDRA-11131 > Project: Cassandra > Issue Type: Improvement > Components: CQL > Environment: Tested from build > [CASSANDRA-11067|https://issues.apache.org/jira/browse/CASSANDRA-11067] > Reporter: DOAN DuyHai > Assignee: Pavel Yaskevich > > Tested from build > [CASSANDRA-11067|https://issues.apache.org/jira/browse/CASSANDRA-11067] > {code:sql} > CREATE KEYSPACE music WITH replication = {'class': 'SimpleStrategy', > 'replication_factor': '1'} AND durable_writes = true; > CREATE TABLE music.albums ( > id int PRIMARY KEY, > artist text, > title text > ); > CREATE CUSTOM INDEX ON music.albums (title) USING > 'org.apache.cassandra.index.sasi.SASIIndex' WITH OPTIONS = > {'tokenization_skip_stop_words': 'true', 'analyzer_class': > 'org.apache.cassandra.index.sasi.analyzer.StandardAnalyzer', > 'case_sensitive': 'false', 'mode': 'CONTAINS', > 'tokenization_enable_stemming': 'true'}; > INSERT INTO music.albums(id, artist, title) VALUES(1, 'Superpitcher', > 'Yesterday'); > INSERT INTO music.albums(id, artist, title) VALUES(2, 'Hilary Duff', 'So > Yesterday'); > INSERT INTO music.albums(id, artist, title) VALUES(3, 'The Mr. T Experience', > 'Yesterday Rules'); > SELECT artist,title FROM music.albums WHERE title LIKE 'Yesterday%'; > InvalidRequest: code=2200 [Invalid query] message="title3 LIKE '<term>%' > restriction is only supported on properly indexed columns" > {code} > It seems that for *CONTAINS* mode, only _%<term>%_ and _%<term>_ syntaxes are > allowed. > Is there any technical reason to ban _<term>%_ syntax ? > Indeed using _%<term>%_ would return all results matched by _<term>%_ -- This message was sent by Atlassian JIRA (v6.3.4#6332)