Searching multiple index with different fieldsTreat child as field of parent in elastic search queryElastic Search - get records by starting character of a fieldElasticsearch global search different filter on multiple indexessubtract two fields in elastic search indexElasticSearch NEST Search Multiple Types & All FieldsElastic Search Adding a Script Field vs Adding a new Index fieldBest database for multiple-column indexes?How to get elasticsearch suggestions working on multiple fields from multiple types?How do I make a field have varying type in Elastic SearchElasticsearch - Can't search using suggestion field (“is not a completion suggest field”)

What was the average temperature of space near the Spitzer Satellite Telescope?

Should I have shared a document with a former employee?

How can electric field be defined as force per charge, if the charge makes its own, singular electric field?

How can I help our ranger feel special about her beast companion?

Is it ethical for a company to ask its employees to move furniture on a weekend?

Is Error correction and detection can be done with out adding extra bits?

Why did Fury respond that way?

Why jet engines sound louder on the ground than inside the aircraft?

Was Apollo 13 radio blackout on reentry longer than expected?

Desecrating Shabbos to ask a Gadol to daven for a patient?

Why a binary file is not shown as 0 and 1?

Amira L'Akum not on Shabbat

How would thermophilic fish survive?

How to draw a winding on a toroid of a circular cross section?

How fast does a character need to move to be effectively invisible?

Why won't some unicode characters print to my terminal?

Is this Android phone Android 9.0 or Android 6.0?

Why can't I hear fret buzz through the amp?

What is the period of Langton's ant on a torus?

Zhora asks Deckard: "Are you for real?". Was this meant to be significant?

Is it legal for a supermarket to refuse to sell an adult beer if an adult with them doesn’t have their ID?

Do dragons smell of lilacs?

Is encryption still applied if you ignore the SSL certificate warning for self signed?

Practical example in using (homotopy) type theory



Searching multiple index with different fields


Treat child as field of parent in elastic search queryElastic Search - get records by starting character of a fieldElasticsearch global search different filter on multiple indexessubtract two fields in elastic search indexElasticSearch NEST Search Multiple Types & All FieldsElastic Search Adding a Script Field vs Adding a new Index fieldBest database for multiple-column indexes?How to get elasticsearch suggestions working on multiple fields from multiple types?How do I make a field have varying type in Elastic SearchElasticsearch - Can't search using suggestion field (“is not a completion suggest field”)






.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty,.everyoneloves__bot-mid-leaderboard:empty margin-bottom:0;








4















We are using ES and getting response properly for 1 index with search fields. I need suggestions of following :


Problem : I have different objects like contact, account have records which is searchable by in account (name field will be used to search) where in contact (Email, phone field will be used to search)



  1. Should I use 1 index and keep contact and account in same index with different type (account, contact) to separate the records.

  2. Should I create 2 index, 1 for account and another for contact.
    Whatever is preferrable, please give me search tips. How it will search based on different fields.

Thank you so much !










share|improve this question




























    4















    We are using ES and getting response properly for 1 index with search fields. I need suggestions of following :


    Problem : I have different objects like contact, account have records which is searchable by in account (name field will be used to search) where in contact (Email, phone field will be used to search)



    1. Should I use 1 index and keep contact and account in same index with different type (account, contact) to separate the records.

    2. Should I create 2 index, 1 for account and another for contact.
      Whatever is preferrable, please give me search tips. How it will search based on different fields.

    Thank you so much !










    share|improve this question
























      4












      4








      4


      1






      We are using ES and getting response properly for 1 index with search fields. I need suggestions of following :


      Problem : I have different objects like contact, account have records which is searchable by in account (name field will be used to search) where in contact (Email, phone field will be used to search)



      1. Should I use 1 index and keep contact and account in same index with different type (account, contact) to separate the records.

      2. Should I create 2 index, 1 for account and another for contact.
        Whatever is preferrable, please give me search tips. How it will search based on different fields.

      Thank you so much !










      share|improve this question














      We are using ES and getting response properly for 1 index with search fields. I need suggestions of following :


      Problem : I have different objects like contact, account have records which is searchable by in account (name field will be used to search) where in contact (Email, phone field will be used to search)



      1. Should I use 1 index and keep contact and account in same index with different type (account, contact) to separate the records.

      2. Should I create 2 index, 1 for account and another for contact.
        Whatever is preferrable, please give me search tips. How it will search based on different fields.

      Thank you so much !







      elasticsearch






      share|improve this question













      share|improve this question











      share|improve this question




      share|improve this question










      asked Mar 26 at 9:46









      OpvOpv

      2121 silver badge14 bronze badges




      2121 silver badge14 bronze badges






















          3 Answers
          3






          active

          oldest

          votes


















          0
















          Here are my answer that I found on official website.



          1. It is preferable to have separate index for each types (Account, Contact) etc.


          2. Use below kind of search json to search among all the indexes.


          "index" : "contacts"
          "query" : "match_all" :
          "index" : "accounts"
          "query" : "match_all" :



          curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch --data-binary "@requests"; echo



          Thanks






          share|improve this answer






























            0














            I think you should know your use case. Suppose There is lots of search queries are going to come which going to access both information like account and contact info, Then i would suggest to make one index. It will help you to perform complex queries like aggregation etc.



            It will also help you to select multiple fields from account as well as contact info.



            If query is going to totally isolated, Then you should go for different dedicated indices. You can simply mention multiple index name by comma separated check this



            Example:



            curl -XGET 'localhost:9200/account,contact/_search?pretty' -H 'application/json' -d'

            "query":
            "name":"foo"

            '





            share|improve this answer






























              0














              In your case 1 account could have multiple contacts so better to have account and contacts in separate index.
              Elasticsearch supports multi index search that can be utilize to execute search on multiple indexes.






              share|improve this answer

























                Your Answer






                StackExchange.ifUsing("editor", function ()
                StackExchange.using("externalEditor", function ()
                StackExchange.using("snippets", function ()
                StackExchange.snippets.init();
                );
                );
                , "code-snippets");

                StackExchange.ready(function()
                var channelOptions =
                tags: "".split(" "),
                id: "1"
                ;
                initTagRenderer("".split(" "), "".split(" "), channelOptions);

                StackExchange.using("externalEditor", function()
                // Have to fire editor after snippets, if snippets enabled
                if (StackExchange.settings.snippets.snippetsEnabled)
                StackExchange.using("snippets", function()
                createEditor();
                );

                else
                createEditor();

                );

                function createEditor()
                StackExchange.prepareEditor(
                heartbeatType: 'answer',
                autoActivateHeartbeat: false,
                convertImagesToLinks: true,
                noModals: true,
                showLowRepImageUploadWarning: true,
                reputationToPostImages: 10,
                bindNavPrevention: true,
                postfix: "",
                imageUploader:
                brandingHtml: "Powered by u003ca class="icon-imgur-white" href="https://imgur.com/"u003eu003c/au003e",
                contentPolicyHtml: "User contributions licensed under u003ca href="https://creativecommons.org/licenses/by-sa/3.0/"u003ecc by-sa 3.0 with attribution requiredu003c/au003e u003ca href="https://stackoverflow.com/legal/content-policy"u003e(content policy)u003c/au003e",
                allowUrls: true
                ,
                onDemand: true,
                discardSelector: ".discard-answer"
                ,immediatelyShowMarkdownHelp:true
                );



                );













                draft saved

                draft discarded


















                StackExchange.ready(
                function ()
                StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55354038%2fsearching-multiple-index-with-different-fields%23new-answer', 'question_page');

                );

                Post as a guest















                Required, but never shown

























                3 Answers
                3






                active

                oldest

                votes








                3 Answers
                3






                active

                oldest

                votes









                active

                oldest

                votes






                active

                oldest

                votes









                0
















                Here are my answer that I found on official website.



                1. It is preferable to have separate index for each types (Account, Contact) etc.


                2. Use below kind of search json to search among all the indexes.


                "index" : "contacts"
                "query" : "match_all" :
                "index" : "accounts"
                "query" : "match_all" :



                curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch --data-binary "@requests"; echo



                Thanks






                share|improve this answer



























                  0
















                  Here are my answer that I found on official website.



                  1. It is preferable to have separate index for each types (Account, Contact) etc.


                  2. Use below kind of search json to search among all the indexes.


                  "index" : "contacts"
                  "query" : "match_all" :
                  "index" : "accounts"
                  "query" : "match_all" :



                  curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch --data-binary "@requests"; echo



                  Thanks






                  share|improve this answer

























                    0












                    0








                    0









                    Here are my answer that I found on official website.



                    1. It is preferable to have separate index for each types (Account, Contact) etc.


                    2. Use below kind of search json to search among all the indexes.


                    "index" : "contacts"
                    "query" : "match_all" :
                    "index" : "accounts"
                    "query" : "match_all" :



                    curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch --data-binary "@requests"; echo



                    Thanks






                    share|improve this answer















                    Here are my answer that I found on official website.



                    1. It is preferable to have separate index for each types (Account, Contact) etc.


                    2. Use below kind of search json to search among all the indexes.


                    "index" : "contacts"
                    "query" : "match_all" :
                    "index" : "accounts"
                    "query" : "match_all" :



                    curl -H "Content-Type: application/x-ndjson" -XGET localhost:9200/_msearch --data-binary "@requests"; echo



                    Thanks







                    share|improve this answer












                    share|improve this answer



                    share|improve this answer










                    answered Mar 28 at 4:18









                    OpvOpv

                    2121 silver badge14 bronze badges




                    2121 silver badge14 bronze badges























                        0














                        I think you should know your use case. Suppose There is lots of search queries are going to come which going to access both information like account and contact info, Then i would suggest to make one index. It will help you to perform complex queries like aggregation etc.



                        It will also help you to select multiple fields from account as well as contact info.



                        If query is going to totally isolated, Then you should go for different dedicated indices. You can simply mention multiple index name by comma separated check this



                        Example:



                        curl -XGET 'localhost:9200/account,contact/_search?pretty' -H 'application/json' -d'

                        "query":
                        "name":"foo"

                        '





                        share|improve this answer



























                          0














                          I think you should know your use case. Suppose There is lots of search queries are going to come which going to access both information like account and contact info, Then i would suggest to make one index. It will help you to perform complex queries like aggregation etc.



                          It will also help you to select multiple fields from account as well as contact info.



                          If query is going to totally isolated, Then you should go for different dedicated indices. You can simply mention multiple index name by comma separated check this



                          Example:



                          curl -XGET 'localhost:9200/account,contact/_search?pretty' -H 'application/json' -d'

                          "query":
                          "name":"foo"

                          '





                          share|improve this answer

























                            0












                            0








                            0







                            I think you should know your use case. Suppose There is lots of search queries are going to come which going to access both information like account and contact info, Then i would suggest to make one index. It will help you to perform complex queries like aggregation etc.



                            It will also help you to select multiple fields from account as well as contact info.



                            If query is going to totally isolated, Then you should go for different dedicated indices. You can simply mention multiple index name by comma separated check this



                            Example:



                            curl -XGET 'localhost:9200/account,contact/_search?pretty' -H 'application/json' -d'

                            "query":
                            "name":"foo"

                            '





                            share|improve this answer













                            I think you should know your use case. Suppose There is lots of search queries are going to come which going to access both information like account and contact info, Then i would suggest to make one index. It will help you to perform complex queries like aggregation etc.



                            It will also help you to select multiple fields from account as well as contact info.



                            If query is going to totally isolated, Then you should go for different dedicated indices. You can simply mention multiple index name by comma separated check this



                            Example:



                            curl -XGET 'localhost:9200/account,contact/_search?pretty' -H 'application/json' -d'

                            "query":
                            "name":"foo"

                            '






                            share|improve this answer












                            share|improve this answer



                            share|improve this answer










                            answered Mar 28 at 5:40









                            Ashish TiwariAshish Tiwari

                            7926 silver badges14 bronze badges




                            7926 silver badges14 bronze badges





















                                0














                                In your case 1 account could have multiple contacts so better to have account and contacts in separate index.
                                Elasticsearch supports multi index search that can be utilize to execute search on multiple indexes.






                                share|improve this answer



























                                  0














                                  In your case 1 account could have multiple contacts so better to have account and contacts in separate index.
                                  Elasticsearch supports multi index search that can be utilize to execute search on multiple indexes.






                                  share|improve this answer

























                                    0












                                    0








                                    0







                                    In your case 1 account could have multiple contacts so better to have account and contacts in separate index.
                                    Elasticsearch supports multi index search that can be utilize to execute search on multiple indexes.






                                    share|improve this answer













                                    In your case 1 account could have multiple contacts so better to have account and contacts in separate index.
                                    Elasticsearch supports multi index search that can be utilize to execute search on multiple indexes.







                                    share|improve this answer












                                    share|improve this answer



                                    share|improve this answer










                                    answered Mar 28 at 5:49









                                    Satyendra SharmaSatyendra Sharma

                                    862 bronze badges




                                    862 bronze badges



























                                        draft saved

                                        draft discarded
















































                                        Thanks for contributing an answer to Stack Overflow!


                                        • Please be sure to answer the question. Provide details and share your research!

                                        But avoid


                                        • Asking for help, clarification, or responding to other answers.

                                        • Making statements based on opinion; back them up with references or personal experience.

                                        To learn more, see our tips on writing great answers.




                                        draft saved


                                        draft discarded














                                        StackExchange.ready(
                                        function ()
                                        StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2fstackoverflow.com%2fquestions%2f55354038%2fsearching-multiple-index-with-different-fields%23new-answer', 'question_page');

                                        );

                                        Post as a guest















                                        Required, but never shown





















































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown

































                                        Required, but never shown














                                        Required, but never shown












                                        Required, but never shown







                                        Required, but never shown







                                        Popular posts from this blog

                                        Kamusi Yaliyomo Aina za kamusi | Muundo wa kamusi | Faida za kamusi | Dhima ya picha katika kamusi | Marejeo | Tazama pia | Viungo vya nje | UrambazajiKuhusu kamusiGo-SwahiliWiki-KamusiKamusi ya Kiswahili na Kiingerezakuihariri na kuongeza habari

                                        Swift 4 - func physicsWorld not invoked on collision? The Next CEO of Stack OverflowHow to call Objective-C code from Swift#ifdef replacement in the Swift language@selector() in Swift?#pragma mark in Swift?Swift for loop: for index, element in array?dispatch_after - GCD in Swift?Swift Beta performance: sorting arraysSplit a String into an array in Swift?The use of Swift 3 @objc inference in Swift 4 mode is deprecated?How to optimize UITableViewCell, because my UITableView lags

                                        Access current req object everywhere in Node.js ExpressWhy are global variables considered bad practice? (node.js)Using req & res across functionsHow do I get the path to the current script with Node.js?What is Node.js' Connect, Express and “middleware”?Node.js w/ express error handling in callbackHow to access the GET parameters after “?” in Express?Modify Node.js req object parametersAccess “app” variable inside of ExpressJS/ConnectJS middleware?Node.js Express app - request objectAngular Http Module considered middleware?Session variables in ExpressJSAdd properties to the req object in expressjs with Typescript