Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Get API: Allow to specify which fields to load #65

Closed
kimchy opened this issue Mar 17, 2010 · 1 comment
Closed

Get API: Allow to specify which fields to load #65

kimchy opened this issue Mar 17, 2010 · 1 comment

Comments

@kimchy
Copy link
Member

kimchy commented Mar 17, 2010

The Get API currently returns the _source. The API should allow to supply fields that will be returned (if stored). By default, the source would still be returned if no fields are specified.

@kimchy
Copy link
Member Author

kimchy commented Mar 17, 2010

Get API: Allow to specify which fields to load, closed by 6243f4f.

rmuir pushed a commit to rmuir/elasticsearch that referenced this issue Nov 8, 2015
Example below. I set the type as text/plain but it is identified as text/html.

```sh
#!/bin/sh

echo "\n\n Delete testidx \n"
curl -XDELETE "http://localhost:9200/testidx"

echo "\n\n Create index and mapping \n"
curl -XPUT "http://localhost:9200/testidx" -d'
{
  "mappings": {
    "session": {
      "properties": {
        "Content": {
          "properties": {
            "content": {
              "type": "attachment",
              "path": "full",
              "store": "yes",
              "fields": {
                "content": {
                  "type": "string",
                  "store": "yes"
                },
                "author": {
                  "type": "string",
                  "store": "yes"
                },
                "title": {
                  "type": "string",
                  "store": "yes"
                },
                "name": {
                  "type": "string",
                  "store": "yes"
                },
                "date": {
                  "type": "date",
                  "format": "dateOptionalTime",
                  "store": "yes"
                },
                "keywords": {
                  "type": "string",
                  "store": "yes"
                },
                "content_type": {
                  "type": "string",
                  "store": "yes"
                },
                "content_length": {
                  "type": "integer",
                  "store": "yes"
                }
              }
            }
          }
        }
      }
    }
  }
}'

echo "\n\n Index document \n"
curl -XPOST "http://localhost:9200/_bulk" -d'
  {"index":{"_index":"testidx","_type":"session"}}
  {"Content":[{"_content_type":"text/plain","content":"BASE64ENCODED_CONTENT"}]}
'

echo "\n\n Refresh \n"
curl -XPOST "http://localhost:9200/testidx/_refresh"

echo "\n\n Get doc type \n"
curl -XPOST "http://localhost:9200/testidx/_search?pretty" -d'
{
  "fields": ["Content.content.content_type","Content.content.content_length","Content.content"]
}'
```

Closes elastic#65.
(cherry picked from commit 38075dc)
maabernethy pushed a commit to maabernethy/elasticsearch that referenced this issue Mar 20, 2017
ywelsch pushed a commit to ywelsch/elasticsearch that referenced this issue Jun 4, 2018
A consequence of elastic#63 is that a FailedToCommitClusterStateException is no longer
thrown by ZenDiscovery#publish(), it is just passed to the listener, so tests
that relied on catching it can no longer work.
henningandersen pushed a commit to henningandersen/elasticsearch that referenced this issue Jun 4, 2020
This track defines an index template that defines common settings. When
bulk-indexing, indices will be automatically created based on this index
template. Therefore, explicit invocation of the create index API are
obsolete (unless they contain additional instructions such as creating
an alias).

With this commit we remove all these tasks and also related tasks (e.g.
it is not necessary to check for cluster health based on a specific
index if that index is not present yet).
This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant