Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8755883
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T13:56:32+00:00 2026-06-13T13:56:32+00:00

I am developing an application that uses elastic search, and in some case I

  • 0

I am developing an application that uses elastic search, and in some case I want to make a search that according to term and locales. I am testing this on localhost

http://localhost:9200/index/type/_search

and parameters

query : {
                        wildcard : { "term" : "myterm*" }
                    },
                    filter : {
                        and : [
                            {
                                term : { "lang" : "en" }
                            },
                            {
                                term : { "translations.lang" : "tr" } //this is subdocument search
                            },
                        ]
                    }

Here is an example document:

{
    "_index": "twitter",
    "_type": "tweet",
    "_id": "5084151d2c6e5d5b11000008",
    "_score": null,
    "_source": {
      "lang": "en",
      "term": "photograph",
      "translations": [
        {
          "_id": "5084151d2c6e5d5b11000009",
          "lang": "tr",
          "translation": "fotoğraf",
          "score": "0",
          "createDate": "2012-10-21T15:30:37.994Z",
          "author": "anonymous"
        },
        {
          "_id": "50850346532b865c2000000a",
          "lang": "tr",
          "translation": "resim",
          "score": "0",
          "createDate": "2012-10-22T08:26:46.670Z",
          "author": "anonymous"
        }
      ],
      "author": "anonymous",
      "createDate": "2012-10-21T15:30:37.994Z"
    }
  }

I am trying to get terms with wildcard(for autocomplete) with input language “en”, and output language “tr”. It is getting terms that has “myterm” but doesnt apply, and operation on this. Any suggestion would be appreciated

Thanks in advance

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-13T13:56:33+00:00Added an answer on June 13, 2026 at 1:56 pm

    I have manage to solve my problem with following query;

    query : {
       wildcard : { "term" : "myterm*" }
    },
    filter : {
       and : [
          {
             term : { "lang" : "en" }
          },
          {
             term : { "translations.lang" : "tr" } //this is subdocument search
          }
       ]
    },
    sort : {
       {"term" : "desc"}
    }
    

    An important point here is, you need to set your sorting field as not_analyzed. Since, you cannot sort a field that is analyzed.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm developing a Java application that uses java.util.logging for its logging needs. This application
I am developing an application that uses javascript to perform some arithmetical calculations in
I'm developing a web application that uses PhoneGap:Build for a mobile version and want
I'm developing a java application that uses some jni calls. I have on C
I'm developing a C# application that uses a handful of XML files and some
I'm developing an application that uses multiple threads to do some intensive calculations as
I'm developing an application that supports multiple locales. This is done through a separate
while developing an Android application that uses Rickshaw to draw some charts, I encountered
I'm developing an iPhone application that uses the iPod library to play some songs.
I am developing a application that uses core data. In my application i would

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.