Code Monkey home page Code Monkey logo

azuresearchemulator's Introduction

Development emulator for Azure Search

This is a small wrapper over SOLR that exposes the Azure Search REST API for development purposes.

It is absolutely not intended to ever run in replacement of Azure Search.

To use it you must first download and install docker.

The container expects to be linked to a SOLR container named solr, listening on a default port (8983), with an already created core with indexed data in it.

The SOLR endpoint can be configured via the SOLR_URL environment variable: if SOLR is reachable from the container at mysolr.example.com, then pass the environment variable SOLR_URL=http://mysolr.example.com:8983/.

For other details, see the surce code or the included docker-compose.yml.

This has been tested with SOLR 6.

Index definition

Indexes cannot be defined via API.

Instead, the wrapper looks for a JSON file in /srv/azuresearch/indexes.json (which can be mounted, see example docker-compose.yml).

The definition file has the following structure:

  {
    "<index_name>": {
      "schema": {
        "<field_name>": {
          "type": "<type_of_field>", // e.g. Edm.String
          "tags": [                  // Field options
            "searchable",
            "retrievable",
            "filterable",
            "sortable",
            "facetable"
          ],
          "is_primary": <true|false>
        }
      }
    }
  }

Indexes are created if missing upon tool start: if they are already existing however they are not updated (they must be deleted via SOLR UI first, so a restart will recreate them)

Unsupported features

These are the main features currently unsupported:

  • index creation and management
  • suggestions
  • document lookup
  • document count with $count endpoint

The indexing feature treats merge and mergeOrUpload as upload.

The search feature does not support the following sub-features (and will return 400 Bad Request):

  • minimumCoverage, scoringParameter, scoringProfile, highlight*
  • geo functions in OData filter queries
  • geo sorting
  • any() / all in OData filter query
  • ascending sorts on facet count or descending on facet value (-count and -value)
  • values option in facets
  • interval option in facets
  • timeoffset option in facets

Error messages do not comply with the standard Azure Search, they are custom.

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.