Searching and indexing of C# C++ .net asp.net doesn't work

curl -XPOST "localhost:9200/scratch" -d "{"""mappings""":{"""test""":
{"""properties""":{"""jobtitle""":
{"""type""":"""string"""},"""location""":
{"""type""":"""geo_point"""}}}}}"

curl -XPUT "http://localhost:9200/scratch/test/1" -d
"{"""jobtitle""":"""C# developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/2" -d
"{"""jobtitle""":"""C++ developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/3" -d
"{"""jobtitle""":"""VB.Net developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/4" -d
"{"""jobtitle""":""".Net developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"

curl -XGET "http://localhost:9200/scratch/test/_search?pretty=true" -d
"{"""query""":{"""match_all""":{}}}"

// Returns record but executing equiv for .net c# and C++ does not
\gnu\bin\curl\curl -XGET "http://localhost:9200/scratch/test/_search?
pretty=true" -d "{"""query""":{"""term""":
{"""jobtitle""":"""vb.net"""}}}"

How can I get this to work?

One option is to search and replace before indexing but I am hoping
there is a better option.
C++ to CPlusPlus
C# to CSharp
.net to dotnet
vb.net to vbdotnet
asp.net to aspdotnet

String properties are analyzed by default. Term queries are not
analyzed, so you are searching on a analyzed field with a non-analyzed
term. You can either set the mapping to non_analyzed or use a field
query/query string.

Ivan

On Mar 9, 4:54 pm, Richardy richard....@gmail.com wrote:

curl -XPOST "localhost:9200/scratch" -d "{"""mappings""":{"""test""":
{"""properties""":{"""jobtitle""":
{"""type""":"""string"""},"""location""":
{"""type""":"""geo_point"""}}}}}"

curl -XPUT "http://localhost:9200/scratch/test/1" -d
"{"""jobtitle""":"""C# developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/2" -d
"{"""jobtitle""":"""C++ developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/3" -d
"{"""jobtitle""":"""VB.Net developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/4" -d
"{"""jobtitle""":""".Net developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"

curl -XGET "http://localhost:9200/scratch/test/_search?pretty=true" -d
"{"""query""":{"""match_all""":{}}}"

// Returns record but executing equiv for .net c# and C++ does not
\gnu\bin\curl\curl -XGET "http://localhost:9200/scratch/test/_search?
pretty=true" -d "{"""query""":{"""term""":
{"""jobtitle""":"""vb.net"""}}}"

How can I get this to work?

One option is to search and replace before indexing but I am hoping
there is a better option.
C++ to CPlusPlus
C# to CSharp
.net to dotnet
vb.net to vbdotnet
asp.net to aspdotnet

Ivan

Thanks for replying so quickly.

I dropped index and recreated using this.

curl -XPOST "localhost:9200/scratch" -d "{"""mappings""":{"""test""":
{"""properties""":{"""jobtitle""":
{"""type""":"""string""","""index""":"""not_analyzed"""},"""location""":
{"""type""":"""geo_point"""}}}}}"

I checked mapping took. It is not_analyzed not non_analyzed according
to Elasticsearch documentation here Elasticsearch Platform — Find real-time answers at scale | Elastic

{
"scratch" : {
"test" : {
"properties" : {
"jobtitle" : {
"index" : "not_analyzed",
"type" : "string"
},
"location" : {
"type" : "geo_point"
}
}
}
}
}

but my searches above still do not work. Interestingly the vb.net one
above no longer works either.

Converting to the following isn't desirable as I want to do keyword
highlighting.
C++ to CPlusPlus
C# to CSharp
.net to dotnet
vb.net to vbdotnet
asp.net to aspdotnet

Any further thoughts for a novice would be appreciated.

Rich

On Mar 9, 10:51 pm, Ivan Brusic ivan_bru...@yahoo.com wrote:

String properties are analyzed by default. Term queries are not
analyzed, so you are searching on a analyzed field with a non-analyzed
term. You can either set the mapping to non_analyzed or use a field
query/query string.

Ivan

On Mar 9, 4:54 pm, Richardy richard....@gmail.com wrote:

curl -XPOST "localhost:9200/scratch" -d "{"""mappings""":{"""test""":
{"""properties""":{"""jobtitle""":
{"""type""":"""string"""},"""location""":
{"""type""":"""geo_point"""}}}}}"

curl -XPUT "http://localhost:9200/scratch/test/1" -d
"{"""jobtitle""":"""C# developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/2" -d
"{"""jobtitle""":"""C++ developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/3" -d
"{"""jobtitle""":"""VB.Net developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"
curl -XPUT "http://localhost:9200/scratch/test/4" -d
"{"""jobtitle""":""".Net developer""","""location""":{"""lat""":
40.12,"""lon""":-71.34}}"

curl -XGET "http://localhost:9200/scratch/test/_search?pretty=true" -d
"{"""query""":{"""match_all""":{}}}"

// Returns record but executing equiv for .net c# and C++ does not
\gnu\bin\curl\curl -XGET "http://localhost:9200/scratch/test/_search?
pretty=true" -d "{"""query""":{"""term""":
{"""jobtitle""":"""vb.net"""}}}"

How can I get this to work?

One option is to search and replace before indexing but I am hoping
there is a better option.
C++ to CPlusPlus
C# to CSharp
.net to dotnet
vb.net to vbdotnet
asp.net to aspdotnet