dse solr suggester status 403 - Unknown command 'suggest'












1















I've followed at least a dozen different examples, all of which look mostly the same. I'm using DSE 5.1 and SOLR and trying to play with the suggester. Here is my configuration (mostly vanilla from the examples):



  <searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>


When I try to run curl to access it on the local host, I get:



message Unknown command 'suggest' in request
description Access to the specified resource has been forbidden


Here is the curl command:



curl --user myuser:mypass 
"http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=Po"


Can't figure out for the life of me why my implementation doesn't work. Any ideas?



Here is the output of the comment to describe the config:



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
<luceneMatchVersion>LUCENE_6_0_1</luceneMatchVersion>
<dseTypeMappingVersion>2</dseTypeMappingVersion>
<directoryFactory class="solr.StandardDirectoryFactory" name="DirectoryFactory"/>
<indexConfig>
<ramBufferSizeMB>512</ramBufferSizeMB>
<rt>false</rt>
</indexConfi`enter code here`g>
<jmx/>
<updateHandler>
<autoSoftCommit>
<maxTime>10000</maxTime>
</autoSoftCommit>
</updateHandler>
<query>
<filterCache class="solr.SolrFilterCache" highWaterMarkMB="2048" lowWaterMarkMB="1024"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<useColdSearcher>true</useColdSearcher>
<maxWarmingSearchers>16</maxWarmingSearchers>
</query>
<requestDispatcher>
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000"/>
<httpCaching never304="true"/>
</requestDispatcher>
<requestHandler class="solr.SearchHandler" default="true" name="search"/>
<requestHandler class="com.datastax.bdp.search.solr.handler.component.CqlSearchHandler" name="solr_query"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/csv" startup="lazy"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/json" startup="lazy"/>
<requestHandler class="solr.FieldAnalysisRequestHandler" name="/analysis/field" startup="lazy"/>
<requestHandler class="solr.DocumentAnalysisRequestHandler" name="/analysis/document" startup="lazy"/>
<requestHandler class="solr.admin.AdminHandlers" name="/admin/"/>
<requestHandler class="solr.PingRequestHandler" name="/admin/ping">
<lst name="invariants">
<str name="qt">search</str>
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<requestHandler class="solr.DumpRequestHandler" name="/debug/dump">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">FSTLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="payloadField">description</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
</config>


Here is the output of the describe on the table:



CREATE TABLE test.movies (
title text PRIMARY KEY,
author text,
description text,
rating float,
release_date timestamp,
solr_query text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE CUSTOM INDEX test_movies_solr_query_index ON test.movies (solr_query) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';

describe active search index schema on test.movies;

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema name="autoSolrSchema" version="1.5">
<types>
<fieldType class="org.apache.solr.schema.StrField" name="StrField"/>
<fieldType class="org.apache.solr.schema.TrieDateField" name="TrieDateField"/>
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/>
<fieldType class="org.apache.solr.schema.TextField" name="TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
</types>
<fields>
<field indexed="true" multiValued="false" name="title" stored="true" type="StrField"/>
<field docValues="true" indexed="true" multiValued="false" name="release_date" stored="true" type="TrieDateField"/>
<field docValues="true" indexed="true" multiValued="false" name="rating" stored="true" type="TrieFloatField"/>
<field indexed="true" multiValued="false" name="author" stored="true" type="TextField"/>
<field indexed="true" multiValued="false" name="description" stored="true" type="TextField"/>
</fields>
<uniqueKey>title</uniqueKey>
</schema>









share|improve this question

























  • Have you reload config? You can look into this example: github.com/alexott/datastax-bootcamp-project/blob/master/cql/… - it's in CQL that is more preferable as XML now

    – Alex Ott
    Dec 15 '18 at 18:35











  • How do you upload this config? Can you run in the cqlsh following command; describe active search index config on test.movies; ?

    – Alex Ott
    Dec 27 '18 at 14:43











  • dsetool -l <user> -p <passwd> create_core test.movies schema=test.movies.schema2 solrconfig=test.movies.config4 (I modified the quesiton above to contain the config describe output)

    – Jim Wartnick
    Dec 28 '18 at 18:02













  • Can you also add output of describe table test.movies; and describe active search index schema on test.movies; ? I just checked my code, and suggester works without problems, although I'm using slightly different classes for lookup.

    – Alex Ott
    Dec 30 '18 at 14:40











  • Added describe output to the original post. Yeah, the people at datastax could not figure it out either. I've tried a brand new cluster and get the same results - so it isn't the cluster, but some configuration (could be an O/S issue (e.g. firewall - which is disabled), or dse issue - not sure).

    – Jim Wartnick
    Jan 2 at 14:59


















1















I've followed at least a dozen different examples, all of which look mostly the same. I'm using DSE 5.1 and SOLR and trying to play with the suggester. Here is my configuration (mostly vanilla from the examples):



  <searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>


When I try to run curl to access it on the local host, I get:



message Unknown command 'suggest' in request
description Access to the specified resource has been forbidden


Here is the curl command:



curl --user myuser:mypass 
"http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=Po"


Can't figure out for the life of me why my implementation doesn't work. Any ideas?



Here is the output of the comment to describe the config:



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
<luceneMatchVersion>LUCENE_6_0_1</luceneMatchVersion>
<dseTypeMappingVersion>2</dseTypeMappingVersion>
<directoryFactory class="solr.StandardDirectoryFactory" name="DirectoryFactory"/>
<indexConfig>
<ramBufferSizeMB>512</ramBufferSizeMB>
<rt>false</rt>
</indexConfi`enter code here`g>
<jmx/>
<updateHandler>
<autoSoftCommit>
<maxTime>10000</maxTime>
</autoSoftCommit>
</updateHandler>
<query>
<filterCache class="solr.SolrFilterCache" highWaterMarkMB="2048" lowWaterMarkMB="1024"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<useColdSearcher>true</useColdSearcher>
<maxWarmingSearchers>16</maxWarmingSearchers>
</query>
<requestDispatcher>
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000"/>
<httpCaching never304="true"/>
</requestDispatcher>
<requestHandler class="solr.SearchHandler" default="true" name="search"/>
<requestHandler class="com.datastax.bdp.search.solr.handler.component.CqlSearchHandler" name="solr_query"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/csv" startup="lazy"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/json" startup="lazy"/>
<requestHandler class="solr.FieldAnalysisRequestHandler" name="/analysis/field" startup="lazy"/>
<requestHandler class="solr.DocumentAnalysisRequestHandler" name="/analysis/document" startup="lazy"/>
<requestHandler class="solr.admin.AdminHandlers" name="/admin/"/>
<requestHandler class="solr.PingRequestHandler" name="/admin/ping">
<lst name="invariants">
<str name="qt">search</str>
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<requestHandler class="solr.DumpRequestHandler" name="/debug/dump">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">FSTLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="payloadField">description</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
</config>


Here is the output of the describe on the table:



CREATE TABLE test.movies (
title text PRIMARY KEY,
author text,
description text,
rating float,
release_date timestamp,
solr_query text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE CUSTOM INDEX test_movies_solr_query_index ON test.movies (solr_query) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';

describe active search index schema on test.movies;

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema name="autoSolrSchema" version="1.5">
<types>
<fieldType class="org.apache.solr.schema.StrField" name="StrField"/>
<fieldType class="org.apache.solr.schema.TrieDateField" name="TrieDateField"/>
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/>
<fieldType class="org.apache.solr.schema.TextField" name="TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
</types>
<fields>
<field indexed="true" multiValued="false" name="title" stored="true" type="StrField"/>
<field docValues="true" indexed="true" multiValued="false" name="release_date" stored="true" type="TrieDateField"/>
<field docValues="true" indexed="true" multiValued="false" name="rating" stored="true" type="TrieFloatField"/>
<field indexed="true" multiValued="false" name="author" stored="true" type="TextField"/>
<field indexed="true" multiValued="false" name="description" stored="true" type="TextField"/>
</fields>
<uniqueKey>title</uniqueKey>
</schema>









share|improve this question

























  • Have you reload config? You can look into this example: github.com/alexott/datastax-bootcamp-project/blob/master/cql/… - it's in CQL that is more preferable as XML now

    – Alex Ott
    Dec 15 '18 at 18:35











  • How do you upload this config? Can you run in the cqlsh following command; describe active search index config on test.movies; ?

    – Alex Ott
    Dec 27 '18 at 14:43











  • dsetool -l <user> -p <passwd> create_core test.movies schema=test.movies.schema2 solrconfig=test.movies.config4 (I modified the quesiton above to contain the config describe output)

    – Jim Wartnick
    Dec 28 '18 at 18:02













  • Can you also add output of describe table test.movies; and describe active search index schema on test.movies; ? I just checked my code, and suggester works without problems, although I'm using slightly different classes for lookup.

    – Alex Ott
    Dec 30 '18 at 14:40











  • Added describe output to the original post. Yeah, the people at datastax could not figure it out either. I've tried a brand new cluster and get the same results - so it isn't the cluster, but some configuration (could be an O/S issue (e.g. firewall - which is disabled), or dse issue - not sure).

    – Jim Wartnick
    Jan 2 at 14:59
















1












1








1








I've followed at least a dozen different examples, all of which look mostly the same. I'm using DSE 5.1 and SOLR and trying to play with the suggester. Here is my configuration (mostly vanilla from the examples):



  <searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>


When I try to run curl to access it on the local host, I get:



message Unknown command 'suggest' in request
description Access to the specified resource has been forbidden


Here is the curl command:



curl --user myuser:mypass 
"http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=Po"


Can't figure out for the life of me why my implementation doesn't work. Any ideas?



Here is the output of the comment to describe the config:



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
<luceneMatchVersion>LUCENE_6_0_1</luceneMatchVersion>
<dseTypeMappingVersion>2</dseTypeMappingVersion>
<directoryFactory class="solr.StandardDirectoryFactory" name="DirectoryFactory"/>
<indexConfig>
<ramBufferSizeMB>512</ramBufferSizeMB>
<rt>false</rt>
</indexConfi`enter code here`g>
<jmx/>
<updateHandler>
<autoSoftCommit>
<maxTime>10000</maxTime>
</autoSoftCommit>
</updateHandler>
<query>
<filterCache class="solr.SolrFilterCache" highWaterMarkMB="2048" lowWaterMarkMB="1024"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<useColdSearcher>true</useColdSearcher>
<maxWarmingSearchers>16</maxWarmingSearchers>
</query>
<requestDispatcher>
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000"/>
<httpCaching never304="true"/>
</requestDispatcher>
<requestHandler class="solr.SearchHandler" default="true" name="search"/>
<requestHandler class="com.datastax.bdp.search.solr.handler.component.CqlSearchHandler" name="solr_query"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/csv" startup="lazy"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/json" startup="lazy"/>
<requestHandler class="solr.FieldAnalysisRequestHandler" name="/analysis/field" startup="lazy"/>
<requestHandler class="solr.DocumentAnalysisRequestHandler" name="/analysis/document" startup="lazy"/>
<requestHandler class="solr.admin.AdminHandlers" name="/admin/"/>
<requestHandler class="solr.PingRequestHandler" name="/admin/ping">
<lst name="invariants">
<str name="qt">search</str>
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<requestHandler class="solr.DumpRequestHandler" name="/debug/dump">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">FSTLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="payloadField">description</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
</config>


Here is the output of the describe on the table:



CREATE TABLE test.movies (
title text PRIMARY KEY,
author text,
description text,
rating float,
release_date timestamp,
solr_query text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE CUSTOM INDEX test_movies_solr_query_index ON test.movies (solr_query) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';

describe active search index schema on test.movies;

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema name="autoSolrSchema" version="1.5">
<types>
<fieldType class="org.apache.solr.schema.StrField" name="StrField"/>
<fieldType class="org.apache.solr.schema.TrieDateField" name="TrieDateField"/>
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/>
<fieldType class="org.apache.solr.schema.TextField" name="TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
</types>
<fields>
<field indexed="true" multiValued="false" name="title" stored="true" type="StrField"/>
<field docValues="true" indexed="true" multiValued="false" name="release_date" stored="true" type="TrieDateField"/>
<field docValues="true" indexed="true" multiValued="false" name="rating" stored="true" type="TrieFloatField"/>
<field indexed="true" multiValued="false" name="author" stored="true" type="TextField"/>
<field indexed="true" multiValued="false" name="description" stored="true" type="TextField"/>
</fields>
<uniqueKey>title</uniqueKey>
</schema>









share|improve this question
















I've followed at least a dozen different examples, all of which look mostly the same. I'm using DSE 5.1 and SOLR and trying to play with the suggester. Here is my configuration (mostly vanilla from the examples):



  <searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>


When I try to run curl to access it on the local host, I get:



message Unknown command 'suggest' in request
description Access to the specified resource has been forbidden


Here is the curl command:



curl --user myuser:mypass 
"http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=Po"


Can't figure out for the life of me why my implementation doesn't work. Any ideas?



Here is the output of the comment to describe the config:



<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<config>
<luceneMatchVersion>LUCENE_6_0_1</luceneMatchVersion>
<dseTypeMappingVersion>2</dseTypeMappingVersion>
<directoryFactory class="solr.StandardDirectoryFactory" name="DirectoryFactory"/>
<indexConfig>
<ramBufferSizeMB>512</ramBufferSizeMB>
<rt>false</rt>
</indexConfi`enter code here`g>
<jmx/>
<updateHandler>
<autoSoftCommit>
<maxTime>10000</maxTime>
</autoSoftCommit>
</updateHandler>
<query>
<filterCache class="solr.SolrFilterCache" highWaterMarkMB="2048" lowWaterMarkMB="1024"/>
<enableLazyFieldLoading>true</enableLazyFieldLoading>
<useColdSearcher>true</useColdSearcher>
<maxWarmingSearchers>16</maxWarmingSearchers>
</query>
<requestDispatcher>
<requestParsers enableRemoteStreaming="true" multipartUploadLimitInKB="2048000"/>
<httpCaching never304="true"/>
</requestDispatcher>
<requestHandler class="solr.SearchHandler" default="true" name="search"/>
<requestHandler class="com.datastax.bdp.search.solr.handler.component.CqlSearchHandler" name="solr_query"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/csv" startup="lazy"/>
<requestHandler class="solr.UpdateRequestHandler" name="/update/json" startup="lazy"/>
<requestHandler class="solr.FieldAnalysisRequestHandler" name="/analysis/field" startup="lazy"/>
<requestHandler class="solr.DocumentAnalysisRequestHandler" name="/analysis/document" startup="lazy"/>
<requestHandler class="solr.admin.AdminHandlers" name="/admin/"/>
<requestHandler class="solr.PingRequestHandler" name="/admin/ping">
<lst name="invariants">
<str name="qt">search</str>
<str name="q">solrpingquery</str>
</lst>
<lst name="defaults">
<str name="echoParams">all</str>
</lst>
</requestHandler>
<requestHandler class="solr.DumpRequestHandler" name="/debug/dump">
<lst name="defaults">
<str name="echoParams">explicit</str>
<str name="echoHandler">true</str>
</lst>
</requestHandler>
<searchComponent name="suggest" class="solr.SuggestComponent">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">FSTLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="payloadField">description</str>
<str name="buildOnStartup">true</str>
</lst>
</searchComponent>
<requestHandler name="/suggest" class="solr.SearchHandler">
<lst name="defaults">
<str name="suggest">true</str>
<str name="suggest.count">10</str>
</lst>
<arr name="components">
<str>suggest</str>
</arr>
</requestHandler>
</config>


Here is the output of the describe on the table:



CREATE TABLE test.movies (
title text PRIMARY KEY,
author text,
description text,
rating float,
release_date timestamp,
solr_query text
) WITH bloom_filter_fp_chance = 0.01
AND caching = {'keys': 'ALL', 'rows_per_partition': 'NONE'}
AND comment = ''
AND compaction = {'class': 'org.apache.cassandra.db.compaction.SizeTieredCompactionStrategy', 'max_threshold': '32', 'min_threshold': '4'}
AND compression = {'chunk_length_in_kb': '64', 'class': 'org.apache.cassandra.io.compress.LZ4Compressor'}
AND crc_check_chance = 1.0
AND dclocal_read_repair_chance = 0.1
AND default_time_to_live = 0
AND gc_grace_seconds = 864000
AND max_index_interval = 2048
AND memtable_flush_period_in_ms = 0
AND min_index_interval = 128
AND read_repair_chance = 0.0
AND speculative_retry = '99PERCENTILE';
CREATE CUSTOM INDEX test_movies_solr_query_index ON test.movies (solr_query) USING 'com.datastax.bdp.search.solr.Cql3SolrSecondaryIndex';

describe active search index schema on test.movies;

<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<schema name="autoSolrSchema" version="1.5">
<types>
<fieldType class="org.apache.solr.schema.StrField" name="StrField"/>
<fieldType class="org.apache.solr.schema.TrieDateField" name="TrieDateField"/>
<fieldType class="org.apache.solr.schema.TrieFloatField" name="TrieFloatField"/>
<fieldType class="org.apache.solr.schema.TextField" name="TextField">
<analyzer>
<tokenizer class="solr.StandardTokenizerFactory"/>
<filter class="solr.LowerCaseFilterFactory"/>
</analyzer>
</fieldType>
</types>
<fields>
<field indexed="true" multiValued="false" name="title" stored="true" type="StrField"/>
<field docValues="true" indexed="true" multiValued="false" name="release_date" stored="true" type="TrieDateField"/>
<field docValues="true" indexed="true" multiValued="false" name="rating" stored="true" type="TrieFloatField"/>
<field indexed="true" multiValued="false" name="author" stored="true" type="TextField"/>
<field indexed="true" multiValued="false" name="description" stored="true" type="TextField"/>
</fields>
<uniqueKey>title</uniqueKey>
</schema>






solr cassandra datastax-enterprise






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited Jan 2 at 14:58







Jim Wartnick

















asked Dec 13 '18 at 14:14









Jim WartnickJim Wartnick

209110




209110













  • Have you reload config? You can look into this example: github.com/alexott/datastax-bootcamp-project/blob/master/cql/… - it's in CQL that is more preferable as XML now

    – Alex Ott
    Dec 15 '18 at 18:35











  • How do you upload this config? Can you run in the cqlsh following command; describe active search index config on test.movies; ?

    – Alex Ott
    Dec 27 '18 at 14:43











  • dsetool -l <user> -p <passwd> create_core test.movies schema=test.movies.schema2 solrconfig=test.movies.config4 (I modified the quesiton above to contain the config describe output)

    – Jim Wartnick
    Dec 28 '18 at 18:02













  • Can you also add output of describe table test.movies; and describe active search index schema on test.movies; ? I just checked my code, and suggester works without problems, although I'm using slightly different classes for lookup.

    – Alex Ott
    Dec 30 '18 at 14:40











  • Added describe output to the original post. Yeah, the people at datastax could not figure it out either. I've tried a brand new cluster and get the same results - so it isn't the cluster, but some configuration (could be an O/S issue (e.g. firewall - which is disabled), or dse issue - not sure).

    – Jim Wartnick
    Jan 2 at 14:59





















  • Have you reload config? You can look into this example: github.com/alexott/datastax-bootcamp-project/blob/master/cql/… - it's in CQL that is more preferable as XML now

    – Alex Ott
    Dec 15 '18 at 18:35











  • How do you upload this config? Can you run in the cqlsh following command; describe active search index config on test.movies; ?

    – Alex Ott
    Dec 27 '18 at 14:43











  • dsetool -l <user> -p <passwd> create_core test.movies schema=test.movies.schema2 solrconfig=test.movies.config4 (I modified the quesiton above to contain the config describe output)

    – Jim Wartnick
    Dec 28 '18 at 18:02













  • Can you also add output of describe table test.movies; and describe active search index schema on test.movies; ? I just checked my code, and suggester works without problems, although I'm using slightly different classes for lookup.

    – Alex Ott
    Dec 30 '18 at 14:40











  • Added describe output to the original post. Yeah, the people at datastax could not figure it out either. I've tried a brand new cluster and get the same results - so it isn't the cluster, but some configuration (could be an O/S issue (e.g. firewall - which is disabled), or dse issue - not sure).

    – Jim Wartnick
    Jan 2 at 14:59



















Have you reload config? You can look into this example: github.com/alexott/datastax-bootcamp-project/blob/master/cql/… - it's in CQL that is more preferable as XML now

– Alex Ott
Dec 15 '18 at 18:35





Have you reload config? You can look into this example: github.com/alexott/datastax-bootcamp-project/blob/master/cql/… - it's in CQL that is more preferable as XML now

– Alex Ott
Dec 15 '18 at 18:35













How do you upload this config? Can you run in the cqlsh following command; describe active search index config on test.movies; ?

– Alex Ott
Dec 27 '18 at 14:43





How do you upload this config? Can you run in the cqlsh following command; describe active search index config on test.movies; ?

– Alex Ott
Dec 27 '18 at 14:43













dsetool -l <user> -p <passwd> create_core test.movies schema=test.movies.schema2 solrconfig=test.movies.config4 (I modified the quesiton above to contain the config describe output)

– Jim Wartnick
Dec 28 '18 at 18:02







dsetool -l <user> -p <passwd> create_core test.movies schema=test.movies.schema2 solrconfig=test.movies.config4 (I modified the quesiton above to contain the config describe output)

– Jim Wartnick
Dec 28 '18 at 18:02















Can you also add output of describe table test.movies; and describe active search index schema on test.movies; ? I just checked my code, and suggester works without problems, although I'm using slightly different classes for lookup.

– Alex Ott
Dec 30 '18 at 14:40





Can you also add output of describe table test.movies; and describe active search index schema on test.movies; ? I just checked my code, and suggester works without problems, although I'm using slightly different classes for lookup.

– Alex Ott
Dec 30 '18 at 14:40













Added describe output to the original post. Yeah, the people at datastax could not figure it out either. I've tried a brand new cluster and get the same results - so it isn't the cluster, but some configuration (could be an O/S issue (e.g. firewall - which is disabled), or dse issue - not sure).

– Jim Wartnick
Jan 2 at 14:59







Added describe output to the original post. Yeah, the people at datastax could not figure it out either. I've tried a brand new cluster and get the same results - so it isn't the cluster, but some configuration (could be an O/S issue (e.g. firewall - which is disabled), or dse issue - not sure).

– Jim Wartnick
Jan 2 at 14:59














1 Answer
1






active

oldest

votes


















0














I wasn't able to reproduce exactly this problem - when I'm using FSTLookupFactory implementation, DSE 5.1.11 throws NullPointerException. But I made it working with AnalyzingInfixLookupFactory implementation, and following config:



  <searchComponent class="solr.SuggestComponent" name="suggest">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="buildOnCommit">true</str>
<str name="exactMatchFirst">true</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>


that was generated by following CQL (it's more preferable than use XML files):



CREATE SEARCH INDEX ON test.movies WITH OPTIONS { reindex : false };
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='title']@type='StrField';
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='description']@type='TextField';

// create suggestion component & corresponding request handler.
ALTER SEARCH INDEX CONFIG ON test.movies ADD searchComponent[@name='suggest',@class='solr.SuggestComponent']
WITH $$ {"suggester":[{"name":"titleSuggester"}, {"lookupImpl":"AnalyzingInfixLookupFactory"}, {"dictionaryImpl":"DocumentDictionaryFactory"},
{"suggestAnalyzerFieldType":"TextField"}, {"field":"title"}, {"weightField":"rating"}, {"buildOnCommit":"true"}, {"exactMatchFirst":"true"}, {"payloadField": "description"}]} $$;
ALTER SEARCH INDEX CONFIG ON test.movies ADD requestHandler[@name='/suggest',@class='solr.SearchHandler']
WITH $$ {"defaults":[{"suggest":"true"}, {"suggest.count":"10"}],"components":["suggest"]} $$;
RELOAD SEARCH INDEX ON test.movies;


and it works:



>curl 'http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=best&wt=json'
{"responseHeader":{"status":0,"QTime":1},
"suggest":{"titleSuggester":{"best":{"numFound":1,
"suggestions":[{"term":"the <b>best</b> movie","weight":1,
"payload":"super movie"}]}}}}





share|improve this answer
























  • So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

    – Jim Wartnick
    Jan 7 at 12:57











  • When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

    – Jim Wartnick
    Jan 7 at 13:00











  • does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

    – Alex Ott
    Jan 7 at 13:06











  • There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

    – Jim Wartnick
    Jan 7 at 13:39











  • yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

    – Alex Ott
    Jan 7 at 14:08











Your Answer






StackExchange.ifUsing("editor", function () {
StackExchange.using("externalEditor", function () {
StackExchange.using("snippets", function () {
StackExchange.snippets.init();
});
});
}, "code-snippets");

StackExchange.ready(function() {
var channelOptions = {
tags: "".split(" "),
id: "1"
};
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function() {
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled) {
StackExchange.using("snippets", function() {
createEditor();
});
}
else {
createEditor();
}
});

function createEditor() {
StackExchange.prepareEditor({
heartbeatType: 'answer',
autoActivateHeartbeat: false,
convertImagesToLinks: true,
noModals: true,
showLowRepImageUploadWarning: true,
reputationToPostImages: 10,
bindNavPrevention: true,
postfix: "",
imageUploader: {
brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
allowUrls: true
},
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
});


}
});














draft saved

draft discarded


















StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53763838%2fdse-solr-suggester-status-403-unknown-command-suggest%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown

























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes









0














I wasn't able to reproduce exactly this problem - when I'm using FSTLookupFactory implementation, DSE 5.1.11 throws NullPointerException. But I made it working with AnalyzingInfixLookupFactory implementation, and following config:



  <searchComponent class="solr.SuggestComponent" name="suggest">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="buildOnCommit">true</str>
<str name="exactMatchFirst">true</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>


that was generated by following CQL (it's more preferable than use XML files):



CREATE SEARCH INDEX ON test.movies WITH OPTIONS { reindex : false };
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='title']@type='StrField';
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='description']@type='TextField';

// create suggestion component & corresponding request handler.
ALTER SEARCH INDEX CONFIG ON test.movies ADD searchComponent[@name='suggest',@class='solr.SuggestComponent']
WITH $$ {"suggester":[{"name":"titleSuggester"}, {"lookupImpl":"AnalyzingInfixLookupFactory"}, {"dictionaryImpl":"DocumentDictionaryFactory"},
{"suggestAnalyzerFieldType":"TextField"}, {"field":"title"}, {"weightField":"rating"}, {"buildOnCommit":"true"}, {"exactMatchFirst":"true"}, {"payloadField": "description"}]} $$;
ALTER SEARCH INDEX CONFIG ON test.movies ADD requestHandler[@name='/suggest',@class='solr.SearchHandler']
WITH $$ {"defaults":[{"suggest":"true"}, {"suggest.count":"10"}],"components":["suggest"]} $$;
RELOAD SEARCH INDEX ON test.movies;


and it works:



>curl 'http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=best&wt=json'
{"responseHeader":{"status":0,"QTime":1},
"suggest":{"titleSuggester":{"best":{"numFound":1,
"suggestions":[{"term":"the <b>best</b> movie","weight":1,
"payload":"super movie"}]}}}}





share|improve this answer
























  • So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

    – Jim Wartnick
    Jan 7 at 12:57











  • When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

    – Jim Wartnick
    Jan 7 at 13:00











  • does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

    – Alex Ott
    Jan 7 at 13:06











  • There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

    – Jim Wartnick
    Jan 7 at 13:39











  • yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

    – Alex Ott
    Jan 7 at 14:08
















0














I wasn't able to reproduce exactly this problem - when I'm using FSTLookupFactory implementation, DSE 5.1.11 throws NullPointerException. But I made it working with AnalyzingInfixLookupFactory implementation, and following config:



  <searchComponent class="solr.SuggestComponent" name="suggest">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="buildOnCommit">true</str>
<str name="exactMatchFirst">true</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>


that was generated by following CQL (it's more preferable than use XML files):



CREATE SEARCH INDEX ON test.movies WITH OPTIONS { reindex : false };
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='title']@type='StrField';
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='description']@type='TextField';

// create suggestion component & corresponding request handler.
ALTER SEARCH INDEX CONFIG ON test.movies ADD searchComponent[@name='suggest',@class='solr.SuggestComponent']
WITH $$ {"suggester":[{"name":"titleSuggester"}, {"lookupImpl":"AnalyzingInfixLookupFactory"}, {"dictionaryImpl":"DocumentDictionaryFactory"},
{"suggestAnalyzerFieldType":"TextField"}, {"field":"title"}, {"weightField":"rating"}, {"buildOnCommit":"true"}, {"exactMatchFirst":"true"}, {"payloadField": "description"}]} $$;
ALTER SEARCH INDEX CONFIG ON test.movies ADD requestHandler[@name='/suggest',@class='solr.SearchHandler']
WITH $$ {"defaults":[{"suggest":"true"}, {"suggest.count":"10"}],"components":["suggest"]} $$;
RELOAD SEARCH INDEX ON test.movies;


and it works:



>curl 'http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=best&wt=json'
{"responseHeader":{"status":0,"QTime":1},
"suggest":{"titleSuggester":{"best":{"numFound":1,
"suggestions":[{"term":"the <b>best</b> movie","weight":1,
"payload":"super movie"}]}}}}





share|improve this answer
























  • So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

    – Jim Wartnick
    Jan 7 at 12:57











  • When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

    – Jim Wartnick
    Jan 7 at 13:00











  • does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

    – Alex Ott
    Jan 7 at 13:06











  • There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

    – Jim Wartnick
    Jan 7 at 13:39











  • yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

    – Alex Ott
    Jan 7 at 14:08














0












0








0







I wasn't able to reproduce exactly this problem - when I'm using FSTLookupFactory implementation, DSE 5.1.11 throws NullPointerException. But I made it working with AnalyzingInfixLookupFactory implementation, and following config:



  <searchComponent class="solr.SuggestComponent" name="suggest">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="buildOnCommit">true</str>
<str name="exactMatchFirst">true</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>


that was generated by following CQL (it's more preferable than use XML files):



CREATE SEARCH INDEX ON test.movies WITH OPTIONS { reindex : false };
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='title']@type='StrField';
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='description']@type='TextField';

// create suggestion component & corresponding request handler.
ALTER SEARCH INDEX CONFIG ON test.movies ADD searchComponent[@name='suggest',@class='solr.SuggestComponent']
WITH $$ {"suggester":[{"name":"titleSuggester"}, {"lookupImpl":"AnalyzingInfixLookupFactory"}, {"dictionaryImpl":"DocumentDictionaryFactory"},
{"suggestAnalyzerFieldType":"TextField"}, {"field":"title"}, {"weightField":"rating"}, {"buildOnCommit":"true"}, {"exactMatchFirst":"true"}, {"payloadField": "description"}]} $$;
ALTER SEARCH INDEX CONFIG ON test.movies ADD requestHandler[@name='/suggest',@class='solr.SearchHandler']
WITH $$ {"defaults":[{"suggest":"true"}, {"suggest.count":"10"}],"components":["suggest"]} $$;
RELOAD SEARCH INDEX ON test.movies;


and it works:



>curl 'http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=best&wt=json'
{"responseHeader":{"status":0,"QTime":1},
"suggest":{"titleSuggester":{"best":{"numFound":1,
"suggestions":[{"term":"the <b>best</b> movie","weight":1,
"payload":"super movie"}]}}}}





share|improve this answer













I wasn't able to reproduce exactly this problem - when I'm using FSTLookupFactory implementation, DSE 5.1.11 throws NullPointerException. But I made it working with AnalyzingInfixLookupFactory implementation, and following config:



  <searchComponent class="solr.SuggestComponent" name="suggest">
<lst name="suggester">
<str name="name">titleSuggester</str>
<str name="lookupImpl">AnalyzingInfixLookupFactory</str>
<str name="dictionaryImpl">DocumentDictionaryFactory</str>
<str name="suggestAnalyzerFieldType">TextField</str>
<str name="field">title</str>
<str name="weightField">rating</str>
<str name="buildOnCommit">true</str>
<str name="exactMatchFirst">true</str>
<str name="payloadField">description</str>
</lst>
</searchComponent>


that was generated by following CQL (it's more preferable than use XML files):



CREATE SEARCH INDEX ON test.movies WITH OPTIONS { reindex : false };
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='title']@type='StrField';
ALTER SEARCH INDEX SCHEMA ON test.movies SET field[@name='description']@type='TextField';

// create suggestion component & corresponding request handler.
ALTER SEARCH INDEX CONFIG ON test.movies ADD searchComponent[@name='suggest',@class='solr.SuggestComponent']
WITH $$ {"suggester":[{"name":"titleSuggester"}, {"lookupImpl":"AnalyzingInfixLookupFactory"}, {"dictionaryImpl":"DocumentDictionaryFactory"},
{"suggestAnalyzerFieldType":"TextField"}, {"field":"title"}, {"weightField":"rating"}, {"buildOnCommit":"true"}, {"exactMatchFirst":"true"}, {"payloadField": "description"}]} $$;
ALTER SEARCH INDEX CONFIG ON test.movies ADD requestHandler[@name='/suggest',@class='solr.SearchHandler']
WITH $$ {"defaults":[{"suggest":"true"}, {"suggest.count":"10"}],"components":["suggest"]} $$;
RELOAD SEARCH INDEX ON test.movies;


and it works:



>curl 'http://localhost:8983/solr/test.movies/suggest?suggest=true&suggest.dictionary=titleSuggester&suggest.q=best&wt=json'
{"responseHeader":{"status":0,"QTime":1},
"suggest":{"titleSuggester":{"best":{"numFound":1,
"suggestions":[{"term":"the <b>best</b> movie","weight":1,
"payload":"super movie"}]}}}}






share|improve this answer












share|improve this answer



share|improve this answer










answered Jan 3 at 16:33









Alex OttAlex Ott

27.4k35172




27.4k35172













  • So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

    – Jim Wartnick
    Jan 7 at 12:57











  • When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

    – Jim Wartnick
    Jan 7 at 13:00











  • does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

    – Alex Ott
    Jan 7 at 13:06











  • There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

    – Jim Wartnick
    Jan 7 at 13:39











  • yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

    – Alex Ott
    Jan 7 at 14:08



















  • So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

    – Jim Wartnick
    Jan 7 at 12:57











  • When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

    – Jim Wartnick
    Jan 7 at 13:00











  • does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

    – Alex Ott
    Jan 7 at 13:06











  • There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

    – Jim Wartnick
    Jan 7 at 13:39











  • yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

    – Alex Ott
    Jan 7 at 14:08

















So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

– Jim Wartnick
Jan 7 at 12:57





So I tried exactly what you had above, and it still fails to work. When I try the exact URL you have, it fails due to requiring authentication. So I add the user:pass@localhost... and get the following message: {"responseHeader":{"status":403},"error":{"msg":"Unknown command 'suggest' in request","code":403}}

– Jim Wartnick
Jan 7 at 12:57













When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

– Jim Wartnick
Jan 7 at 13:00





When I remove the &wt=json, I see the following, again: Access to the specified resource has been forbidden

– Jim Wartnick
Jan 7 at 13:00













does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

– Alex Ott
Jan 7 at 13:06





does user has correct permissions to search indexes? Look here: docs.datastax.com/en/dse/5.1/dse-admin/datastax_enterprise/… Also look to this one: docs.datastax.com/en/datastax_enterprise/5.0/…

– Alex Ott
Jan 7 at 13:06













There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

– Jim Wartnick
Jan 7 at 13:39





There were no permissions on the search indices so I granted ALL PERMISSIONS on ALL INDICES to my user and re-tried, it failed. What I did find out is that what seems to be causing the issue is the "authorization_options" in the dse.yaml. When I un-comment that (which is what we use) I get the errors described above. When I comment out the authorization_options, it seems to work. So not sure why that's causing problems but I've tried all combinations of it uncommented and it fails for every one of them. It only works when commented out.

– Jim Wartnick
Jan 7 at 13:39













yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

– Alex Ott
Jan 7 at 14:08





yeah, that's something with permissions I think... Maybe it makes sense to file a support ticket?

– Alex Ott
Jan 7 at 14:08


















draft saved

draft discarded




















































Thanks for contributing an answer to Stack Overflow!


  • Please be sure to answer the question. Provide details and share your research!

But avoid



  • Asking for help, clarification, or responding to other answers.

  • Making statements based on opinion; back them up with references or personal experience.


To learn more, see our tips on writing great answers.




draft saved


draft discarded














StackExchange.ready(
function () {
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f53763838%2fdse-solr-suggester-status-403-unknown-command-suggest%23new-answer', 'question_page');
}
);

Post as a guest















Required, but never shown





















































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown

































Required, but never shown














Required, but never shown












Required, but never shown







Required, but never shown







Popular posts from this blog

Monofisismo

Angular Downloading a file using contenturl with Basic Authentication

Olmecas