2017-03-20 5 views
1

En utilisant le dernier paquet awscli, installé via pip sur python 3. Avoir un conflit de validation avec AWS CloudSearch:AWS CLI/Boto3 CloudSearch conflit Validation

Commande:

[email protected]:~$ aws cloudsearch define-analysis-scheme --domain-name domain-clitest --analysis-scheme '{ "AnalysisSchemeName": "stopwords", "AnalysisSchemeLanguage": "en", "AnalysisOptions": {"Stopwords": "http"}}'

Retours cette erreur:

An error occurred (InvalidType) when calling the DefineAnalysisScheme operation: Stopwords must be a json array

je modifie alors les mots vides comme un seul ensemble d'éléments:

[email protected]:~$ aws cloudsearch define-analysis-scheme --domain-name domain-clitest --analysis-scheme '{ "AnalysisSchemeName": "stopwords", "AnalysisSchemeLanguage": "en", "AnalysisOptions": {"Stopwords": ["http"]}}'

Il échoue à nouveau, à la recherche d'une chaîne:

Invalid type for parameter AnalysisScheme.AnalysisOptions.Stopwords, value: ['http'], type: class 'list, valid types: class 'str'

Même le CLI documentation semble contradictoire:

Stopwords ->(string)

A JSON array of terms to ignore during indexing and searching. For example, ["a", "an", "the", "of"] . The stopwords dictionary must explicitly list each word you want to ignore. Wildcards and regular expressions are not supported.

Merci!

Répondre

2

donc Stopwords est une valeur de chaîne représentant un tableau JSON des termes d'ignorer lors de l'indexation et la recherche:

[email protected]:~$ aws cloudsearch define-analysis-scheme --domain-name domain-clitest --analysis-scheme \ 
'{ "AnalysisSchemeName": "stopwords",\ 
    "AnalysisSchemeLanguage": "en", \ 
    "AnalysisOptions": { "Stopwords": "[\"http\"]" }}'