javaquery

set field data = true on java elasticsearch

こ雲淡風輕ζ 提交于 2020-01-11 10:59:47
问题 Running a java elastic search query through Eclipse. Getting this error when I am testing it, and I can't find anywhere in the API that tells me how I can set this field data to true IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [created] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.] Does anyone know how I can fix this? 回答1:

I am trying to get location information from ip address in JAVA but I am getting a java.net.SocketException: Connection reset error

时间秒杀一切 提交于 2019-12-21 21:04:24
问题 import java.io.IOException; import java.io.PrintWriter; import javax.servlet.ServletException; import javax.servlet.http.HttpServlet; import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import javaQuery.importClass.javaQueryBundle; import javaQuery.j2ee.GeoLocation; /** * Servlet implementation class IP */ public class IP extends HttpServlet { private static final long serialVersionUID = 1L; /** * @see HttpServlet#HttpServlet() */ public IP() { super()

How implement regex for a textfield to allow one comma one space at a time in Extjs

Deadly 提交于 2019-12-13 03:25:47
问题 I am working on a textfield to make it allow only numbers with max one comma and one space(max) at any occurrence. It can accept value like "5,8", "5 ,8" and "5 , 8". It should not allow two or more spaces or commas at a time. I have tried below code but its not working. this.regex = new RegExp('^\\d+(?\s\\d+)?(?:,\\d*(?\s\\d+)?)*$'); 回答1: This is quite a simple solution. In order to accept possible characters you can use ? , which signifies exactly 0 or exactly 1 occurrence of the preceding

set field data = true on java elasticsearch

☆樱花仙子☆ 提交于 2019-12-02 02:24:48
Running a java elastic search query through Eclipse. Getting this error when I am testing it, and I can't find anywhere in the API that tells me how I can set this field data to true IllegalArgumentException[Fielddata is disabled on text fields by default. Set fielddata=true on [created] in order to load fielddata in memory by uninverting the inverted index. Note that this can however use significant memory. Alternatively use a keyword field instead.] Does anyone know how I can fix this? You must modify index mapping properties: try (XContentBuilder jsonBuilder = XContentFactory.jsonBuilder())