Hi,
maybe there is another way around this but my problem started with a
search query that had an index and type already created.The query always
returned a SearchResult. So I built my logic around that, i.e using the
SearchResult object in my JSP page.
But when I restarted fresh I had no index and type created (only a
mapping file) and as such I got some IndexMissing excpetions instead. I
then created the index. But I still got exception due to the type that
was missing.
There seems not to be a way to create a type. The only way to have the
type created is to insert a dummy document and remove it. That way I
finally got the SerachResult with 0 hits wich I expected in the first run...
Of course I could create some logic in the JSP page to handle null
values for the SearchResult, but that would be much messier. I even
tried to create an empty SearchResult, but there was no public
constructor...
So, I would love if there was a way to create the type (which would put
the index in a a state equal to that when the type exists, but has 0
documents).
So, I would love if there was a way to create the type (which would put
the index in a a state equal to that when the type exists, but has 0
documents).
Yes, I am aware of the put-mapping API, but I do not put mappings
explicitly from code. I have a mappings file that set things up. I could
not find a way to put a mapping with reference to that file. If that
exists all is well.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.