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

Typeahead #22

Open
reissmann opened this issue Nov 8, 2014 · 1 comment
Open

Typeahead #22

reissmann opened this issue Nov 8, 2014 · 1 comment

Comments

@reissmann
Copy link
Member

How to implement typeahead?

This depends on #21. There are the following solutions:

@reissmann reissmann reopened this Nov 8, 2014
@reissmann
Copy link
Member Author

Working solution using the completion suggester:

Create index:

curl -X PUT "http://localhost:9200/syslog" -d '{
"mappings" : {
    "event" : {
        "properties" : {
            "host" : {
                "type" : "string",
                "index" : "not_analyzed"
            },
            "host_suggest" : {
                "type" :     "completion"
            },
            [...]
        }
    }
}
}'

Configure rsyslog:

set $!host = $hostname;
set $!host_suggest = $hostname;
template(name="outfmt" type="list") {
    property(name="$!")
    constant(value="\n")
}

module(load="omelasticsearch")
action(type="omelasticsearch" template="outfmt"
            searchIndex="syslog"
            asyncrepl="on"
            searchType="event"
            server="127.0.0.1"
            serverport="9200"

Search for documents:

{
  "event": {
    "text": "lo",
    "completion": {
      "field": "host_suggest"
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant