Giter Site home page Giter Site logo

Comments (6)

ksaveras avatar ksaveras commented on July 28, 2024
POST http://127.0.0.1:9200/str_1970_01/_update_by_query

{
    "query" : {
        "term" : {
            "source_id": "4543"
        }
    },
    "script" : "ctx._source.source_id = 4544"
}
{
error: "NoClassDefFoundError[org/elasticsearch/rest/XContentThrowableRestResponse]; nested: ClassNotFoundException[org.elasticsearch.rest.XContentThrowableRestResponse]; "
status: 500
}

BTW does this plugin support filtering? Filters works quicked than search queries I guess.

from elasticsearch-action-updatebyquery.

laureek avatar laureek commented on July 28, 2024

+1

from elasticsearch-action-updatebyquery.

consulthys avatar consulthys commented on July 28, 2024

+1

from elasticsearch-action-updatebyquery.

consulthys avatar consulthys commented on July 28, 2024

@xawiers, filters are definitely supported.

The idea is to use either a constant_score or a filtered query (instead of term et al), as follows:

curl -XPOST http://127.0.0.1:9200/str_1970_01/_update_by_query -d '{"query": {
  "constant_score" : {
    "filter" : {
      "term" : {
        "source_id" : "4543"
      }
    }
  }
}, "script": "ctx._source.source_id = \"4544\";"}'

from elasticsearch-action-updatebyquery.

laureek avatar laureek commented on July 28, 2024

I started work on updating this plugin for ES 1.2.1. These are the changes I have made so far to the current master.

Pom.xml updates:

<properties>
        <lucene.version>4.8.1</lucene.version>
        <elasticsearch.version>1.2.1</elasticsearch.version>
        <tests.jvms>1</tests.jvms>
        <tests.shuffle>true</tests.shuffle>
        <tests.output>onerror</tests.output>
        <tests.client.ratio />
        <es.logger.level>INFO</es.logger.level>
    </properties>

To Resolve Failed test when packaging the code:

In src/main/java/org.elasticsearch.action.updatebyquery.TransportUpdateByQueryAction.java
From:

String[] concreteIndices = metaData.concreteIndices(request.indices(), IndicesOptions.lenient());

To:

String[] concreteIndices = metaData.concreteIndices(IndicesOptions.lenientExpandOpen() ,request.indices());

In src/main/java/org.elasticsearch.action.updatebyquery.TransportShardUpdateByQueryAction.java
From:

searchContext.clearAndRelease()

To:

 searchContext.close()

( 3 instances )

To Resolve Warning:
elasticsearch-action-updatebyquery-master/src/main/java/org/elasticsearch/rest/action/updatebyquery/RestUpdateByQueryAction.java:40: error: cannot find symbol

The following Classes no longer exist in 1.2.1 (1.2.0 and above)
RestXContentBuilder
XContentRestResponse
XContentThrowableRestResponse

However, some of the code has to be re-written within RestUpdateByQueryAction.java to utilize the new JsonXContent method of parsing using Jackson, since we can't pass the request object into the function as we did previously.

from elasticsearch-action-updatebyquery.

laureek avatar laureek commented on July 28, 2024

I created a pull request that addresses this issue.

from elasticsearch-action-updatebyquery.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.