Created
October 9, 2012 22:52
-
-
Save kierenj/3861975 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
DELETE http://indriyax:9200/content/news | |
(gives 200 OK) | |
PUT http://indriyax:9200/content/news/_mapping | |
{ | |
"news": { | |
"properties": { | |
"TextContent": { | |
"type": "string", | |
"index": "analyzed", | |
"store": "yes", | |
"analyzer": "htmlContentAnalyzer" | |
} | |
} | |
} | |
} | |
(gives 200 OK) | |
POST http://indriyax:9200/content/news | |
{ | |
"ContentType": "news", | |
"WrapperClass": "CloudSite.CoreLogicApi.NewsContentItem, CloudSite.CoreLogicApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", | |
"Title": "A First news title here", | |
"CreatedByUsername": null, | |
"CreatedByDisplayName": null, | |
"CreatedDate": "0001-01-01T00:00:00", | |
"UpdatedDate": "0001-01-01T00:00:00", | |
"TextContent": "Today, something happened" | |
} | |
(gives 200 OK, my ID back, etc) | |
POST http://indriyax:9200/content/news | |
{ | |
"ContentType": "news", | |
"WrapperClass": "CloudSite.CoreLogicApi.NewsContentItem, CloudSite.CoreLogicApi, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null", | |
"Title": "B Second news title here", | |
"CreatedByUsername": null, | |
"CreatedByDisplayName": null, | |
"CreatedDate": "0001-01-01T00:00:00", | |
"UpdatedDate": "0001-01-01T00:00:00", | |
"TextContent": "Today, something <strong>really</strong> happened" | |
} | |
(same deal, 200 OK, get my ID back) | |
POST http://indriyax:9200/content/news/_search | |
{ | |
"query": { | |
"match": { | |
"_all": "strong" | |
} | |
} | |
} | |
With the above, I get one result, the section item that was indexed. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment