Hello,
I'll answer inline. Excuse my Gmail messing with your numbering
On Mon, Sep 2, 2013 at 2:06 AM, ddorian43 dorian.hoxha@gmail.com wrote:
I'm new to Elasticsearch and i've read some of the docs and still have
some questions:
- I have a 'user' document. This user can belong to several 'groups'
and have several settings for each group. How can i have a mapping so i can
search on users that have a group_id and administrator in that group
storing all data in the user document?
You can have a nested
typehttp://www.elasticsearch.org/guide/reference/mapping/nested-type/under
each user, to get something like:
{
"name": "test-user",
"groups": [
{
"group_id": 1,
"is_admin": true
},
{
"group_id": 2,
"is_admin": false
}
]
}
And then to search, you can wrap a bool
queryhttp://www.elasticsearch.org/guide/reference/query-dsl/bool-query.htmlin
a nested
query http://www.elasticsearch.org/guide/reference/query-dsl/nested-query/and
specify the group_id and the is_admin value you need. And it will only
match users who have a group object with both properties.
- Fields that aren't specified in the mapping are not indexed?
Because i don't want to index/search on every field.
If a field is not in the mapping, when you add a new document that has it,
ES will try and guess what that field is and append the mapping for you.
Unless you disable dynamic mappings, in which case indexing that document
will fail.
If you need to disable indexing a field, you can have "index": "no" for
that field. Its content will still be stored in the _source field.
- Are documents/_source compressed together in blocks or separately?
In 0.90 or later, they're compressed in blocks.
- If i store the _source i don't need to store fields?
No, the fields will be retrieved from source. You can still store
individual fields (or store fields and not _source), but the default is
recommended.
- If i update a document and change a non-indexed/non-mapped field
will the document be reindexed?
When you update a document, it's reindexed. A field that's not mapped can't
be changed, because it means it's not there. If a field is stored, but not
indexed, it can be updated, but it will still not be indexed. I hope this
answers your question, because I'm not sure I'm getting it.
- If i only want to text-search on 3
fields(title,arrays,description) should i put only these in the _all
field or something else?
That's an option, yes. Or you can search in all three fields (for example,
by using a multi_match or a bool query).
- Can i search 'more_like_this' WHERE a=1 AND b=24 AND c=True ?
I don't think you can. For integers and booleans, you can simply query for
those values using something like a term query.
- Should i use ECC RAM ?
If it's something your motherboard supports, I guess some extra reliability
never hurts
Best regards,
Radu
http://sematext.com/ -- Elasticsearch -- Solr -- Lucene
--
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.