Quantcast

Elasticsearch Couchdb river Mapping problem

classic Classic list List threaded Threaded
3 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Elasticsearch Couchdb river Mapping problem

srilatha nallapati
I have the Elastisearch couchdb river installed. I am looking to creating mappings for my database. I have different types of documents in my couchdb database. I want to specify an individual mapping for each type of document.

I tried this way and is throwing an error.
 
PUT http://localhost:9200/_river/user/_mapping
{
 
    "user" : {
      "properties" : {
        "first_name" : {
          "type" : "string",
          "search_analyzer" : "str_search_analyzer",
          "index_analyzer" : "str_index_analyzer"
        }
      }
      ,

  "settings" : {
    "analysis" : {
      "analyzer" : {
        "str_search_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase"]
        },

        "str_index_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase", "substring"]
        }
      },

      "filter" : {
        "substring" : {
          "type" : "edgeNGram",
          "min_gram" : 2,
          "max_gram"  : 20
        }
      }
    }
  }
  }
}

ERROR:
{"error":"MapperParsingException[Analyzer [str_search_analyzer] not found for field [first_name]]","status":400}


Can any one help me how this can be rectified or any such kind of JSON examples?

Also, I need to give mapping for few more fields like "last_name", "organization" etc. How I can specify multiple fields in the above example? 


Thanks,
Srilatha

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Elasticsearch Couchdb river Mapping problem

dadoonet
Hey,

1st: 
Create your analyzer when you create your index: Something like the following (I did not check the exact syntax):
$ curl -XPUT 'http://localhost:9200/whateveryourindexis/' -d '{
    "settings" : {
"analysis" : {
      "analyzer" : {
        "str_search_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase"]
        },

        "str_index_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase", "substring"]
        }
      },

      "filter" : {
        "substring" : {
          "type" : "edgeNGram",
          "min_gram" : 2,
          "max_gram"  : 20
        }
      }
    }

    }
}'


2nd: you want to define a mapping for your type user under index "whateveryourindexis".
Don't send a mapping to the special index _river

Send something like:
    "user" : {
      "properties" : {
        "first_name" : {
          "type" : "string",
          "search_analyzer" : "str_search_analyzer",
          "index_analyzer" : "str_index_analyzer"
        }
}'



Then, you can create the river.

Does it help?

-- 
David Pilato | Technical Advocate | Elasticsearch.com



Le 14 févr. 2013 à 15:14, srilatha nallapati <[hidden email]> a écrit :

I have the Elastisearch couchdb river installed. I am looking to creating mappings for my database. I have different types of documents in my couchdb database. I want to specify an individual mapping for each type of document.

I tried this way and is throwing an error.
 
PUT http://localhost:9200/_river/user/_mapping
{
 
    "user" : {
      "properties" : {
        "first_name" : {
          "type" : "string",
          "search_analyzer" : "str_search_analyzer",
          "index_analyzer" : "str_index_analyzer"
        }
      }
      ,

  "settings" : {
    "analysis" : {
      "analyzer" : {
        "str_search_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase"]
        },

        "str_index_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase", "substring"]
        }
      },

      "filter" : {
        "substring" : {
          "type" : "edgeNGram",
          "min_gram" : 2,
          "max_gram"  : 20
        }
      }
    }
  }
  }
}

ERROR:
{"error":"MapperParsingException[Analyzer [str_search_analyzer] not found for field [first_name]]","status":400}


Can any one help me how this can be rectified or any such kind of JSON examples?

Also, I need to give mapping for few more fields like "last_name", "organization" etc. How I can specify multiple fields in the above example? 


Thanks,
Srilatha

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Elasticsearch Couchdb river Mapping problem

srilatha nallapati
Hi David,

I created analyzer, mapping and then river. It is working fine now.

Thank you very much for your help.


On Thursday, February 14, 2013 7:56:05 PM UTC+5:30, David Pilato wrote:
Hey,

1st: 
Create your analyzer when you create your index: Something like the following (I did not check the exact syntax):
$ curl -XPUT 'http://localhost:9200/whateveryourindexis/' -d '{
    "settings" : {
"analysis" : {
      "analyzer" : {
        "str_search_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase"]
        },

        "str_index_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase", "substring"]
        }
      },

      "filter" : {
        "substring" : {
          "type" : "edgeNGram",
          "min_gram" : 2,
          "max_gram"  : 20
        }
      }
    }

    }
}'


2nd: you want to define a mapping for your type user under index "whateveryourindexis".
Don't send a mapping to the special index _river

Send something like:
    "user" : {
      "properties" : {
        "first_name" : {
          "type" : "string",
          "search_analyzer" : "str_search_analyzer",
          "index_analyzer" : "str_index_analyzer"
        }
}'



Then, you can create the river.

Does it help?

-- 
David Pilato | Technical Advocate | Elasticsearch.com



Le 14 févr. 2013 à 15:14, srilatha nallapati <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="E5JZ500N-jcJ">srila...@...> a écrit :

I have the Elastisearch couchdb river installed. I am looking to creating mappings for my database. I have different types of documents in my couchdb database. I want to specify an individual mapping for each type of document.

I tried this way and is throwing an error.
 
PUT http://localhost:9200/_river/user/_mapping
{
 
    "user" : {
      "properties" : {
        "first_name" : {
          "type" : "string",
          "search_analyzer" : "str_search_analyzer",
          "index_analyzer" : "str_index_analyzer"
        }
      }
      ,

  "settings" : {
    "analysis" : {
      "analyzer" : {
        "str_search_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase"]
        },

        "str_index_analyzer" : {
          "tokenizer" : "keyword",
          "filter" : ["lowercase", "substring"]
        }
      },

      "filter" : {
        "substring" : {
          "type" : "edgeNGram",
          "min_gram" : 2,
          "max_gram"  : 20
        }
      }
    }
  }
  }
}

ERROR:
{"error":"MapperParsingException[Analyzer [str_search_analyzer] not found for field [first_name]]","status":400}


Can any one help me how this can be rectified or any such kind of JSON examples?

Also, I need to give mapping for few more fields like "last_name", "organization" etc. How I can specify multiple fields in the above example? 


Thanks,
Srilatha

--
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 <a href="javascript:" target="_blank" gdf-obfuscated-mailto="E5JZ500N-jcJ">elasticsearc...@googlegroups.com.
For more options, visit https://groups.google.com/groups/opt_out.
 
 

--
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 [hidden email].
For more options, visit https://groups.google.com/groups/opt_out.
 
 
Loading...