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 8600185
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 12, 20262026-06-12T01:33:38+00:00 2026-06-12T01:33:38+00:00

I have the following query that I am trying to use to delete data

  • 0

I have the following query that I am trying to use to delete data from an ElasticSearch index.

{
    "filter": {
        "and": [
            {
                "range": {
                    "Time": {
                        "from": "20120101T000000",
                        "to": "20120331T000000"
                    }
                }
            },
            {
                "term": {
                    "Source": 1
                }
            }
        ]
    }
}

I have tried to delete documents based on this query. This query returns results fine when I run it against the index. But when I try to run a delete command against the index, nothing happens.

I am not sure if I am constructiing the query wrong or what else.

  • 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-12T01:33:40+00:00Added an answer on June 12, 2026 at 1:33 am

    You’re using only a filter while the delete by query API probably needs a query. You can convert your filter to a query using a filtered query like this:

    {
        "filtered" : {
            "query" : {
                "match_all" : {}
            },
            "filter": {
                "and": [
                    {
                        "range": {
                            "Time": {
                                "from": "20120101T000000",
                                "to": "20120331T000000"
                            }
                        }
                    },
                    {
                        "term": {
                            "Source": 1
                        }
                    }
                ]
            }
        }
    }
    

    Otherwise you could convert your filter to a query using a bool query with two must clauses, so that you don’t need a filtered query anymore. Anyway, I guess the filter approach is better since filters are faster.

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

Sidebar

Related Questions

I have the following query that works well. SELECT DISTINCT city,region1,region2 from static_geo_world where
I'm trying to use Entity Framework to query database and I have following code
I have a query that strips data from a XML string, inserts it into
I'm trying to use the following query syntax from a php file: $sql =
I have the following LINQ query that returns two objects from my database. These
I'm trying to run following query but it throws an error. DELETE b FROM
I have the following SQL query that I am trying to run inside Microsoft
I have the following little query that produces a parsing error. I am trying
Good Day, I have a sql query that returns the following data: EmployeeID...Employee 555..........John
I have the following query that joins a bunch of tables. I'd like to

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.