Giter VIP home page Giter VIP logo

elasticsearch-solr-api's Introduction

Elasticsearch Solr API

Overview

This plugin allows you to use elasticsearch with Solr interfaces. The original project is mocksolrplugin, this project forked from it and was renamed in order to avoid confusion about each projects.

Supported Solr features

  • Update handlers
  • XML Update Handler (ie. /update)
  • JavaBin Update Handler (ie. /update/javabin)
  • Search handler (ie. /select)
  • Basic lucene queries using the q paramter
  • start, rows, and fl parameters
  • sorting
  • filter queries (fq parameters)
  • hit highlighting (hl, hl.fl, hl.snippets, hl.fragsize, hl.simple.pre, hl.simple.post)
  • faceting (facet, facet.field, facet.query, facet.sort, facet.limit)
  • XML and JavaBin request and response formats

Install Solr API plugin

Type the following command:

$ ./bin/plugin --install org.codelibs/elasticsearch-solr-api/1.7.0

Versions

Solr API elasticsearch Lucene/Solr
master 1.6.x 4.10.4
1.7.0 1.5.2 4.10.4
1.6.0 1.4.0.Beta1 4.10.1
1.5.2 1.3.4 4.9.1
1.4.0 1.2.0 4.8.1
1.3.0 1.0.0 4.6.1
1.2.2 0.90.5 4.4.0

Issues/Questions

Please file an issue. (Japanese forum is here.)

How to use this plugin.

Just point your Solr client/tool to your elasticsearch instance and appending /_solr to the url.

http://localhost:9200/[index]/[type]/_solr/[select|update]
  • [index] - the elasticsearch index you want to index/search against. Default "solr".
  • [type] - the elasticsearch type you want to index/search against. Default "docs".

elasticsearch-solr-api's People

Contributors

johtani avatar marevol avatar mattweber avatar paulera avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

elasticsearch-solr-api's Issues

Can't work with this plugin

I am using Elasticsearch version 1.3.1 and plugin version 1.5.0. I have installed the plugin and restarted the ES service. While restarting the service, it shows an INFO in the console as :
org.codelibs.elasticsearch.solr.rest.SolrUpdateRestAction] [myClusterName] Solr input document id's will not be hashed to created Elasticsearch document id's

I have an index named "customer" and type named "accounts". I have tried the URL as follows : http://localhost:9200/customer/accounts/_solr. It shows a message as :
No handler found for uri [/customer/accounts/_solr] and method [GET]

Please help

unable to connect

Hi,

I'm having a problem connecting to index using the plugin.

Here's what I've done:

./bin/plugin --install org.codelibs/elasticsearch-solr-api/1.3.0

Plugin installed properly (afaik)

curl -XGET "localhost:9200/solr/_status?pretty=true" gives:


{
  "_shards" : {
    "total" : 10,
    "successful" : 5,
    "failed" : 0
  },
  "indices" : {
    "solr" : {
      "index" : {
        "primary_size_in_bytes" : 495,
        "size_in_bytes" : 495
      },
      "translog" : {
        "operations" : 0
      },
      "docs" : {
        "num_docs" : 0,
        "max_doc" : 0,
        "deleted_docs" : 0
      },
      "merges" : {
        "current" : 0,
        "current_docs" : 0,
        "current_size_in_bytes" : 0,
        "total" : 0,
        "total_time_in_millis" : 0,
        "total_docs" : 0,
        "total_size_in_bytes" : 0
      },
      "refresh" : {
        "total" : 5,
        "total_time_in_millis" : 0
      },
      "flush" : {
        "total" : 0,
        "total_time_in_millis" : 0
      },
      "shards" : {
        "0" : [ {
          "routing" : {
            "state" : "STARTED",
            "primary" : true,
            "node" : "CvQthJ0OQAi7trrnx-xvZA",
            "relocating_node" : null,
            "shard" : 0,
            "index" : "solr"
          },
          "state" : "STARTED",
          "index" : {
            "size_in_bytes" : 99
          },
          "translog" : {
            "id" : 1404741667883,
            "operations" : 0
          },
          "docs" : {
            "num_docs" : 0,
            "max_doc" : 0,
            "deleted_docs" : 0
          },
          "merges" : {
            "current" : 0,
            "current_docs" : 0,
            "current_size_in_bytes" : 0,
            "total" : 0,
            "total_time_in_millis" : 0,
            "total_docs" : 0,
            "total_size_in_bytes" : 0
          },
          "refresh" : {
            "total" : 1,
            "total_time_in_millis" : 0
          },
          "flush" : {
            "total" : 0,
            "total_time_in_millis" : 0
          }
        } ],
        "1" : [ {
          "routing" : {
            "state" : "STARTED",
            "primary" : true,
            "node" : "CvQthJ0OQAi7trrnx-xvZA",
            "relocating_node" : null,
            "shard" : 1,
            "index" : "solr"
          },
          "state" : "STARTED",
          "index" : {
            "size_in_bytes" : 99
          },
          "translog" : {
            "id" : 1404741668033,
            "operations" : 0
          },
          "docs" : {
            "num_docs" : 0,
            "max_doc" : 0,
            "deleted_docs" : 0
          },
          "merges" : {
            "current" : 0,
            "current_docs" : 0,
            "current_size_in_bytes" : 0,
            "total" : 0,
            "total_time_in_millis" : 0,
            "total_docs" : 0,
            "total_size_in_bytes" : 0
          },
          "refresh" : {
            "total" : 1,
            "total_time_in_millis" : 0
          },
          "flush" : {
            "total" : 0,
            "total_time_in_millis" : 0
          }
        } ],
        "2" : [ {
          "routing" : {
            "state" : "STARTED",
            "primary" : true,
            "node" : "CvQthJ0OQAi7trrnx-xvZA",
            "relocating_node" : null,
            "shard" : 2,
            "index" : "solr"
          },
          "state" : "STARTED",
          "index" : {
            "size_in_bytes" : 99
          },
          "translog" : {
            "id" : 1404741668129,
            "operations" : 0
          },
          "docs" : {
            "num_docs" : 0,
            "max_doc" : 0,
            "deleted_docs" : 0
          },
          "merges" : {
            "current" : 0,
            "current_docs" : 0,
            "current_size_in_bytes" : 0,
            "total" : 0,
            "total_time_in_millis" : 0,
            "total_docs" : 0,
            "total_size_in_bytes" : 0
          },
          "refresh" : {
            "total" : 1,
            "total_time_in_millis" : 0
          },
          "flush" : {
            "total" : 0,
            "total_time_in_millis" : 0
          }
        } ],
        "3" : [ {
          "routing" : {
            "state" : "STARTED",
            "primary" : true,
            "node" : "CvQthJ0OQAi7trrnx-xvZA",
            "relocating_node" : null,
            "shard" : 3,
            "index" : "solr"
          },
          "state" : "STARTED",
          "index" : {
            "size_in_bytes" : 99
          },
          "translog" : {
            "id" : 1404741667972,
            "operations" : 0
          },
          "docs" : {
            "num_docs" : 0,
            "max_doc" : 0,
            "deleted_docs" : 0
          },
          "merges" : {
            "current" : 0,
            "current_docs" : 0,
            "current_size_in_bytes" : 0,
            "total" : 0,
            "total_time_in_millis" : 0,
            "total_docs" : 0,
            "total_size_in_bytes" : 0
          },
          "refresh" : {
            "total" : 1,
            "total_time_in_millis" : 0
          },
          "flush" : {
            "total" : 0,
            "total_time_in_millis" : 0
          }
        } ],
        "4" : [ {
          "routing" : {
            "state" : "STARTED",
            "primary" : true,
            "node" : "CvQthJ0OQAi7trrnx-xvZA",
            "relocating_node" : null,
            "shard" : 4,
            "index" : "solr"
          },
          "state" : "STARTED",
          "index" : {
            "size_in_bytes" : 99
          },
          "translog" : {
            "id" : 1404741668234,
            "operations" : 0
          },
          "docs" : {
            "num_docs" : 0,
            "max_doc" : 0,
            "deleted_docs" : 0
          },
          "merges" : {
            "current" : 0,
            "current_docs" : 0,
            "current_size_in_bytes" : 0,
            "total" : 0,
            "total_time_in_millis" : 0,
            "total_docs" : 0,
            "total_size_in_bytes" : 0
          },
          "refresh" : {
            "total" : 1,
            "total_time_in_millis" : 0
          },
          "flush" : {
            "total" : 0,
            "total_time_in_millis" : 0
          }
        } ]
      }
    }
  }
}

However, the command:

curl -XGET 'http://localhost:9200/solr/docs/' gives:

No handler found for uri [/solr/docs/] and method [GET]

Also,

curl -XGET 'http://localhost:9200/solr/docs/_solr' gives:

No handler found for uri [/solr/docs/_solr] and method [GET]

What am I doing wrong? Any help will be appreciated.

Work with WPSolr plugin for Wordpress?

Hello,
I'm not a developer so not sure if this is a feasible feature - but I've been trying to use
Solr with Wordpress and there is a plugin, WPSolr, that works fairly well but does not
display facets properly on my site.

Elasticsearch works great but I'm having issues rendering the results properly.

I'm wondering if I install this plugin if I could then use it with WPsolr to access an ElasticSearch index?

Thanks!
Rob

Upgrade to ES 2

So, ES 2 changed a lot of things on plugin schema. If it's possible (as I'm no Java developer, sorry :( ) would like to ask to port this plugin to ES 2.

Thank you very much!

Filter queries not working with custom date formats

I have created an index with a custom date format. The mapping as follows :
curl -XPUT http://localhost:9200/sample -d '
{
"mappings" : {
"feeds" : {
"_all" : {
"enabled" : "false"
},
"properties" : {
"category" : { "type" : "string", "index" : "analyzed", "store" : "yes"},
"name" : { "type" : "string", "index" : "analyzed", "store" : "yes"},
"modified_date" : { "type" : "date", "index" : "analyzed", "store" : "yes", "format" : "yyyy-MM-dd HH:mm:ss.SSS"}
}
}
}
}'

And inserted 1 document as follows :
curl -XPUT http://localhost:9200/sample/feeds/1 -d '
{
"category" : "Books",
"name" : "Hadoop In Action",
"modified_date" : "2014-09-01 01:00:24.002"
}'

After that I have tried to select document by using a URL as follows :
http://localhost:9200/sample/feeds/_solr/select/?q=_&fq=modified_date:[2014-09-01 01:00:24.002+TO+now]
Getting an error like this :
{"error":"SearchPhaseExecutionException[Failed to execute phase [query_fetch], all shards failed; shardFailures {[lmakYvazRtK9ju8LSuTv5w][sample][0]: SearchParseException[[sample][0]: from[0],size[10]: Parse Failure [Failed to parse source [{"from":0,"size":10,"query":{"filtered":{"query":{"query_string":{"query":"_","auto_generate_phrase_queries":true,"lowercase_expanded_terms":false}},"filter":{"query":{"query_string":{"query":"modified_date:[2014-09-01 01:00:24.002 TO now]"}}}}},"sort":[{"_score":{"order":"desc"}}]}]]]; nested: QueryParsingException[[sample] Failed to parse query [modified_date:[2014-09-01 01:00:24.002 TO now]]]; nested: ParseException[Cannot parse 'modified_date:[2014-09-01 01:00:24.002 TO now]': Encountered " "TO" "TO "" at line 1, column 39.\nWas expecting one of:\n "]" ...\n "}" ...\n ]; nested: ParseException[Encountered " "TO" "TO "" at line 1, column 39.\nWas expecting one of:\n "]" ...\n "}" ...\n ]; }]","status":400}

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.