1

I've got an index, urls, which looks like this:

path: {
   type: "string"
},
@timestamp: {
   type: "date",
   format: "strict_date_optional_time||epoch_millis"
},

The path will store the PATH section from a url, e.g:

https://facebook.com/profile/photos/album/1

Would be stored as:

/profile/photos/album/1

I'm storing all sorts of paths, so there could be more like:

/profile/photos/album/1
/profile/photos/album/2
/profile/photos/album/2
/profile/photos/album/2
/profile/friends/1
/profile/friends/2
/newsfeed/me/
/newsfeed/me/
/newsfeed/friendName/

I'm trying to find out the number of unique pageviews each of the paths have. I'm unsure how I should do this, should I use a regexp?

I'd imagine it'd look something like (pseudo code):

{
    "query": {
      "regexp": {
            "path": "" 
        },
        "unique": true
    }
}
4

1 に答える 1