Package com.google.appengine.api.search.Document

Examples of com.google.appengine.api.search.Document.Builder.addField()


    @Test(expected = IllegalArgumentException.class)
    public void testMultipleDateField() {
        Builder docBuilder = Document.newBuilder();
        docBuilder.addField(Field.newBuilder().setName("datefield").setDate(new Date()));
        docBuilder.addField(Field.newBuilder().setName("datefield").setDate(new Date()));
    }
}
View Full Code Here


        Index index = searchService.getIndex(IndexSpec.newBuilder().setName(indexName));
        delDocs(index);

        Builder docBuilder = Document.newBuilder();
        Field field = Field.newBuilder().setName("textfield").setText("text field").build();
        docBuilder.addField(field);
        field = Field.newBuilder().setName("numberfield").setNumber(123).build();
        docBuilder.addField(field);
        Date now = new Date();
        field = Field.newBuilder().setName("datefield").setDate(now).build();
        docBuilder.addField(field);
View Full Code Here

        Builder docBuilder = Document.newBuilder();
        Field field = Field.newBuilder().setName("textfield").setText("text field").build();
        docBuilder.addField(field);
        field = Field.newBuilder().setName("numberfield").setNumber(123).build();
        docBuilder.addField(field);
        Date now = new Date();
        field = Field.newBuilder().setName("datefield").setDate(now).build();
        docBuilder.addField(field);
        field = Field.newBuilder().setName("htmlfield").setHTML("<html>html field</html>").build();
        docBuilder.addField(field);
View Full Code Here

        docBuilder.addField(field);
        field = Field.newBuilder().setName("numberfield").setNumber(123).build();
        docBuilder.addField(field);
        Date now = new Date();
        field = Field.newBuilder().setName("datefield").setDate(now).build();
        docBuilder.addField(field);
        field = Field.newBuilder().setName("htmlfield").setHTML("<html>html field</html>").build();
        docBuilder.addField(field);
        User currentUser = new User("prometheus-qa@appenginetest.com", "appenginetest.com");
        field = Field.newBuilder().setName("atomfield").setAtom(currentUser.getAuthDomain()).build();
        docBuilder.addField(field);
View Full Code Here

        docBuilder.addField(field);
        Date now = new Date();
        field = Field.newBuilder().setName("datefield").setDate(now).build();
        docBuilder.addField(field);
        field = Field.newBuilder().setName("htmlfield").setHTML("<html>html field</html>").build();
        docBuilder.addField(field);
        User currentUser = new User("prometheus-qa@appenginetest.com", "appenginetest.com");
        field = Field.newBuilder().setName("atomfield").setAtom(currentUser.getAuthDomain()).build();
        docBuilder.addField(field);
        GeoPoint geoPoint = new GeoPoint((double) -10, 10.000001);
        field = Field.newBuilder().setName("geofield").setGeoPoint(geoPoint).build();
View Full Code Here

        docBuilder.addField(field);
        field = Field.newBuilder().setName("htmlfield").setHTML("<html>html field</html>").build();
        docBuilder.addField(field);
        User currentUser = new User("prometheus-qa@appenginetest.com", "appenginetest.com");
        field = Field.newBuilder().setName("atomfield").setAtom(currentUser.getAuthDomain()).build();
        docBuilder.addField(field);
        GeoPoint geoPoint = new GeoPoint((double) -10, 10.000001);
        field = Field.newBuilder().setName("geofield").setGeoPoint(geoPoint).build();
        docBuilder.addField(field);
        index.put(docBuilder);
        sync();
View Full Code Here

        User currentUser = new User("prometheus-qa@appenginetest.com", "appenginetest.com");
        field = Field.newBuilder().setName("atomfield").setAtom(currentUser.getAuthDomain()).build();
        docBuilder.addField(field);
        GeoPoint geoPoint = new GeoPoint((double) -10, 10.000001);
        field = Field.newBuilder().setName("geofield").setGeoPoint(geoPoint).build();
        docBuilder.addField(field);
        index.put(docBuilder);
        sync();

        Results<ScoredDocument> result = searchDocs(index, "", 0);
        assertEquals(1, result.getNumberReturned());
View Full Code Here

            Calendar cal = Calendar.getInstance();
            DateFormat dfDate = new SimpleDateFormat("yyyy,M,d");
            for (int i = 0; i < docCount; i++) {
                Builder docBuilder = Document.newBuilder();
                // two text field with different locale
                docBuilder.addField(Field.newBuilder().setName("textfield").setText("text with num " + i));
                Field field = Field.newBuilder().setName("textfield").setText("C'est la vie " + i).setLocale(Locale.FRENCH).build();
                docBuilder.addField(field);
                docBuilder.addField(Field.newBuilder().setName("numfield").setNumber(i));
                String dateVal = "" + cal.get(Calendar.YEAR) + ",";
                dateVal += cal.get(Calendar.MONTH) + ",";
View Full Code Here

            for (int i = 0; i < docCount; i++) {
                Builder docBuilder = Document.newBuilder();
                // two text field with different locale
                docBuilder.addField(Field.newBuilder().setName("textfield").setText("text with num " + i));
                Field field = Field.newBuilder().setName("textfield").setText("C'est la vie " + i).setLocale(Locale.FRENCH).build();
                docBuilder.addField(field);
                docBuilder.addField(Field.newBuilder().setName("numfield").setNumber(i));
                String dateVal = "" + cal.get(Calendar.YEAR) + ",";
                dateVal += cal.get(Calendar.MONTH) + ",";
                int day = cal.get(Calendar.DATE) + i;
                dateVal += day;
View Full Code Here

                Builder docBuilder = Document.newBuilder();
                // two text field with different locale
                docBuilder.addField(Field.newBuilder().setName("textfield").setText("text with num " + i));
                Field field = Field.newBuilder().setName("textfield").setText("C'est la vie " + i).setLocale(Locale.FRENCH).build();
                docBuilder.addField(field);
                docBuilder.addField(Field.newBuilder().setName("numfield").setNumber(i));
                String dateVal = "" + cal.get(Calendar.YEAR) + ",";
                dateVal += cal.get(Calendar.MONTH) + ",";
                int day = cal.get(Calendar.DATE) + i;
                dateVal += day;
                docBuilder.addField(Field.newBuilder().setName("datefield").setDate(dfDate.parse(dateVal)));
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.