Hi,
my issue is next :
when i use the SearchQuery to find documents containing terms that start with the specified prefix i have no result.
Here the simple code :
final SearchResult result = this.cluster.searchQuery("data-bucket_index_proc", SearchQuery.prefix("SAO2"), SearchOptions.searchOptions().fields("service"));
for (final SearchRow row : result.rows()) {
System.out.println("Score: " + row.score());
System.out.println("Document Id: " + row.id());
}
Here my_index :
{
“name”: “data-bucket_index_proc”,
“type”: “fulltext-index”,
“params”: {
“doc_config”: {
“docid_prefix_delim”: “”,
“docid_regexp”: “”,
“mode”: “type_field”,
“type_field”: “type”
},
“mapping”: {
“default_analyzer”: “standard”,
“default_datetime_parser”: “dateTimeOptional”,
“default_field”: “_all”,
“default_mapping”: {
“dynamic”: true,
“enabled”: false
},
“default_type”: “_default”,
“docvalues_dynamic”: false,
“index_dynamic”: true,
“store_dynamic”: false,
“type_field”: “_type”,
“types”: {
“procedure”: {
“dynamic”: true,
“enabled”: true,
“properties”: {
“creationDate”: {
“enabled”: true,
“dynamic”: false,
“fields”: [
{
“include_in_all”: true,
“index”: true,
“name”: “creationDate”,
“store”: true,
“type”: “datetime”
}
]
},
“modifiedDate”: {
“enabled”: true,
“dynamic”: false,
“fields”: [
{
“include_in_all”: true,
“index”: true,
“name”: “modifiedDate”,
“store”: true,
“type”: “datetime”
}
]
},
“service”: {
“enabled”: true,
“dynamic”: false,
“fields”: [
{
“include_in_all”: true,
“index”: true,
“name”: “service”,
“store”: true,
“type”: “text”
}
]
},
“titre”: {
“enabled”: true,
“dynamic”: false,
“fields”: [
{
“include_in_all”: true,
“index”: true,
“name”: “titre”,
“store”: true,
“type”: “text”
}
]
}
}
}
}
},
“store”: {
“indexType”: “scorch”,
“segmentVersion”: 15
}
},
“sourceType”: “gocbcore”,
“sourceName”: “data-bucket”,
“sourceUUID”: “0eda5e9d80c010f98245513c8cc14ad7”,
“sourceParams”: {},
“planParams”: {
“maxPartitionsPerPIndex”: 1024,
“indexPartitions”: 1,
“numReplicas”: 0
},
“uuid”: “759d659f4458be9f”
}
And here a capture of my index in the console
I try to find documents with type “procedure” and “service” starts with “SAO2”
Here a example of document which have a “service” starts with “SAO2”:
I must do something wrong but i don’t see what.
Thanks for your help.
Jerome