Can I have some types of one index, mapped to couchdb river?

Hi!

I like to use ES with CouchDB as a content server, I mean return data from ES without server-side controller at all.
I setup river and plays with pre-mapped index.
It`s necessary for me to have TWO types of index:

  1. short - where EXcluded some fields ( "index" : "no", "include_in_all" : "false") (actually I use dynamic templates futures at mapping - its incredibly cool things)

  2. full - all fields are INcluded

I need it in reason of logics and productivity - some clients may not use _search?q=field:term constriction and may gets strange results.

And, my question is - may I have two( or more) types in one river index?
I try to use something

index : { "index" : "my_river_index","type" : [ "short","full" ] }

at river create, but it don`t working and get broke short index too.

I can use another one index, but is it good practice - to double data, or I missed something in ES architect?

Dmitry.

PS. Sorry for my English, my mother thongs language is Russian.

If you use two types, then it will be the same as if you are using two indices. You double the data by indexing two types of documents.

Whats wrong with going just with the full version, I did not understand that? In any case, if you want to do it, you can just set up two rivers working against hte same couchdb, each indexing into a different index or type.
On Monday, February 14, 2011 at 9:26 AM, Dmitry Karpich wrote:

Hi!

I like to use ES with CouchDB as a content server, I mean return data from ES without server-side controller at all.
I setup river and plays with pre-mapped index.
It`s necessary for me to have TWO types of index:

  1. short - where EXcluded some fields ( "index" : "no", "include_in_all" : "false") (actually I use dynamic templates futures at mapping - its incredibly cool things)

  2. full - all fields are INcluded

I need it in reason of logics and productivity - some clients may not use _search?q=field:term constriction and may gets strange results.

And, my question is - may I have two( or more) types in one river index?
I try to use something

index : { "index" : "my_river_index","type" : [ "short","full" ] }

at river create, but it don`t working and get broke short index too.

I can use another one index, but is it good practice - to double data, or I missed something in ES architect?

Dmitry.

PS. Sorry for my English, my mother thongs language is Russian.

Hello and thank you for answer!

Ok, I do using two independent indices, I think it`s not problem, just Relation-Data-Base rudiment in my mind.

Dmitry.

PS. Whats wrong?

So, I make sort of books database, and , for example, its contains next fields -
ISBN, author, annotation, title.

I have API, called - SearchBookByISBNAuthorTitle (yes, indeed it index/type in ES, covered by ngnix)

And its works wrong, because search looking in annotation too, if we are create index on full document.
Many-many trash line in output. Its logical error, of corse, not couchDB nor ES.

To solve this problem we are need to create two index - short and full.
Feeling its be nice and fast.

On Feb 16, 2011, at 4:54 AM, Shay Banon wrote:

If you use two types, then it will be the same as if you are using two indices. You double the data by indexing two types of documents.

Whats wrong with going just with the full version, I did not understand that? In any case, if you want to do it, you can just set up two rivers working against hte same couchdb, each indexing into a different index or type.
On Monday, February 14, 2011 at 9:26 AM, Dmitry Karpich wrote:

Hi!

I like to use ES with CouchDB as a content server, I mean return data from ES without server-side controller at all.
I setup river and plays with pre-mapped index.
It`s necessary for me to have TWO types of index:
<...>