I'm trying to find a way to use Elasticsearch to query a field that is both period and hyphen-delimited.

I have a (MySQL) data-set like this (using SQLAlchemy to access it):

```
id    text        tag
====================================
1     some-text   A.B.c3
2     more. text  A.B-C.c4
3     even more.  B.A-32.D-24.f9

```

The core reason I use ES for search in the first place is that I want to query against the `text` field. That part works awesome!

But, (I think) I want the the `tag` to appear in the inverted index like this (I probably won't take case into account, just including it for illustration):

```
A.B.c3            1
A.B-C.c4          2
B.A-C2.D-24.f9    3

```

Then, I want to search the `tag` field like this:

```
{ "query": {
      "prefix" : { "tag" : "A.B" }
    }
}

```

And have the query return `id`/rows/documents 1 and 2.

Basically, I want the query to match the index(es) in this truth table:

```
"A." = 1, 2
"A-" = 3

```

How do I accomplish both the "`A.`" match at the beginning, differentiate between a period and a hyphen (possibly boost this), and match mid-phrase based on those same delimiters?

I'd also like to weight these matches higher if they occur at the beginning of the `tag` field if possible.

How do I do this, or is Elasticsearch not the right tool for the job? It seems like Elasticsearch works great for my text-field comparisons on normally delimited English text, but the tag-based searches seem much harder.

**UPDATE:** It seems that when I index only a subset of the data that my searches return the results I would expect but when querying against the full data-set, I get fewer hits.