hi all
j'indexe mes documents en utilisant fs river,
i user the folowing index:
curl -XPUT 'http://localhost:9200/mydocs/' -d '{
"settings" : {"index" : {"analysis" :
{"analyzer" : {
"synfromfile" : {"tokenizer" : "whitespace","filter" : ["synonym"]},
"autocomplete" : {"tokenizer" : "whitespace","filter" :
["lowercase","engram"]}},
"filter" : {"synonym" : {"type" : "synonym", "synonyms_path" :
"C:\TempElasticSearch\synonym\synonyms.txt"},
"engram" : {"type" : "edgeNGram","min_gram" : 3,"max_gram" : 10}}}}}}'
the folowing mapping
curl -XPUT 'http://localhost:9200/mydocs/doc/_mapping' -d '
{"doc" : {
"properties" : {
"file" : { "type" : "attachment",
"path" : "full",
"fields" : {"file" : {"type" : "string","store" : "yes","term_vector" :
"with_positions_offsets","analyzer" : "synfromfile"},
"author" : {"type" : "string"},
"title" : {"type" : "string","store" : "yes"},
"date" : {"type" : "date","format" : "dateOptionalTime"},
"keywords" : {"type" : "string"},
"content_type" : {"type" : "string" }}},
"name" : {"type" : "string","analyzer" : "autocomplete"},
"pathEncoded" : {"type" : "string"},
"postDate" : {"type" : "date","format" : "dateOptionalTime"},
"rootpath" : {"type" : "string"},
"virtualpath" : { "type" : "string"}}}}'
and the folowing river
curl -XPUT 'localhost:9200/_river/Myfs_river/_meta' -d '{
"type": "fs",
"fs": {
"name": "fs river",
"url": "C:\TempElasticSearch\tempDoc",
"update_rate": 180000,
"includes": [ ".doc" , ".docx", ".xls", ".pdf", "*.txt" ]},
"index": { "index": "mydocs","type": "doc"}
}'
but when looking through a document keyword (search for a word that exists
in the content of a document) metadata of the documents returned does not
contain the field author !!!!
i use the folowing query:
TermsFacetBuilder fb = FacetBuilders.termsFacet(TERMS_FACET_F).field(
TYPE_FIELD);
QueryBuilder queryBuilder = QueryBuilders.queryString(keyword);
SearchResponse searchHits = esClient.prepareSearch()
.setIndices(INDEX_NAME)
.setSearchType(SearchType.DFS_QUERY_THEN_FETCH).addFacet(fb)
.setFrom(query.getStart()).setSize(query.getRow())
.setQuery(queryBuilder).addHighlightedField(NAME_FIELD)
.addHighlightedField(FILE_FIELD).setHighlighterOrder(SCORE)
.execute().actionGet();
return searchHits;
and i have this result : looking for "application" key world
{
"took" : 1133,
"timed_out" : false,
"_shards" : {
"total" : 5,
"successful" : 5,
"failed" : 0
},
"hits" : {
"total" : 3,
"max_score" : 0.078125,
"hits" : [ {
"_index" : "mydocs",
"_type" : "doc",
"_id" : "19943db2a847cbb66daf35446bab775",
"_score" : 0.078125, "_source" :
{"name":"ElasticSearch.docx","postDate":1365068589756,"pathEncoded":"8580d27817ab2e7da7fd9c55a54c81cc","rootpath":"8580d27817ab2e7da7fd9c55a54c81cc","virtualpath":"c","file":{"_name":"ElasticSearch.docx","content":"KLMN......
"highlight" : {
"file" : [ "notre application se fait
dans le fichier application-context comme suit :\n<bean
id="esClient"\n\t\tclass="fr", "comme une application distribuée et répartit la charge entre les
nœuds.\nIndexe :\nAu moment ou en crée un" ]
}
}, {
"_index" : "mydocs",
"_type" : "doc",
"_id" : "33711747ec838172ca777eba396127",
"_score" : 0.078125, "_source" :
{"name":"ElasticSearch1.docx","postDate":1365069178174,"pathEncoded":"8580d27817ab2e7da7fd9c55a54c81cc","rootpath":"8580d27817ab2e7da7fd9c55a54c81cc","virtualpath":"c","file":{"_name":"ElasticSearch1.docx","content":"UEs....
"highlight" : {
"file" : [ "notre application se fait
dans le fichier application-context comme suit :\n<bean
id="esClient"\n\t\tclass="fr", "comme une application distribuée et répartit la charge entre les
nœuds.\nIndexe :\nAu moment ou en crée un" ]
}
} ]
},
"facets" : {
"f" : {
"_type" : "terms",
"missing" : 0,
"total" : 3,
"other" : 0,
"terms" : [ {
"term" : "doc",
"count" : 3
} ]
}
}
}
I do not know where the problem lies !!!!
Cordially
Yahia
--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.