Search for a sequence

Hello,

I have a collection of strings with ordered user events, produced by a 3rd
party system, that looks like this:

USER A -> 10:1 11 10:2 10:3 1201:1
USER B -> 10:1 10:2 10:3 10:4

, where every word is an event, generated by that user.

Event has a following format:

<event ID, 2 digits><related item ID, 2 digits>:<amount, any number of digits>

With ElasticSearch I want to count all documents (users) that have a
certain sequence of events:

10 -> 10 -> 10
10:1 -> 10:3
11 -> 1201

In some cases I need to search by event ID, only - item ID and amount are
optional.

What is the proper way to achieve that in ElasticSearch?

Currently, I store those sequences in MongoDB, and perform search/count
with complex regexes.

Thank you!

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/8d5cd78d-af67-4a71-8a37-2948e083c3ea%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.

Not quite sure I understand 100% the requirements. So if I have these 2
documents:

Doc 1 -> 10:1 11 10:2 10:3 1201:1
Doc 2 -> 10:1 10:2 10:3 10:4

What would each of these queries return?

  1. 10 11 10
  2. 10 10 10
  3. 10 10 11
  4. 10 12
  5. 10:3 1201

--
You received this message because you are subscribed to the Google Groups "elasticsearch" group.
To unsubscribe from this group and stop receiving emails from it, send an email to elasticsearch+unsubscribe@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/elasticsearch/f97c11a0-5b1e-4a64-8574-4c71054cc9e1%40googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.