List<DocumentPut> createDocs() {
        List<DocumentPut> documents = new ArrayList<>();
        documents.add(createDocument("id:myspace:test::anything", 24, 2.0f, "foo", "bar"));
        documents.add(createDocument("id:anotherspace:test::foo", 13, 4.1f, "bar", "foo"));
        documents.add(createDocument("id:myspace:test:n=1234:mail1", 15, 1.0f, "some", "some"));
        documents.add(createDocument("id:myspace:test:n=5678:bar", 14, 2.4f, "Yet", "More"));
        documents.add(createDocument("id:myspace:test:n=2345:mail2", 15, 1.0f, "bar", "baz"));
        documents.add(createDocument("id:myspace:test:g=mygroup:qux", 15, 1.0f, "quux", "corge"));
        documents.add(createDocument("id:myspace:test::missingint", null, 2.0f, null, "bar"));
        documents.add(createDocument("id:myspace:test::ampersand", null, 2.0f, null, "&"));
        documents.add(createDocument("id:foo:test::withtruefield", null, 0.0f, null, ""));
        documents.add(createDocument("id:foo:test::withfalsefield", null, 0.0f, null, ""));

        // Add some array/struct info to doc 1
        Struct sval = new Struct(documents.get(1).getDocument().getField("mystruct").getDataType());
        sval.setFieldValue("key", new IntegerFieldValue(14));
        sval.setFieldValue("value", new StringFieldValue("structval"));
        documents.get(1).getDocument().setFieldValue("mystruct", sval);
        Array<Struct> aval = new Array<>(documents.get(1).getDocument().getField("structarray").getDataType());
        {
            Struct sval1 = new Struct(aval.getDataType().getNestedType());
            sval1.setFieldValue("key", new IntegerFieldValue(15));
            sval1.setFieldValue("value", new StringFieldValue("structval1"));
            Struct sval2 = new Struct(aval.getDataType().getNestedType());
            sval2.setFieldValue("key", new IntegerFieldValue(16));
            sval2.setFieldValue("value", new StringFieldValue("structval2"));
            aval.add(sval1);
            aval.add(sval2);
        }
        documents.get(1).getDocument().setFieldValue("structarray", aval);
        {
            var tensor = Tensor.from("tensor(x[2]):[0.1, 0.2]");
            documents.get(1).getDocument().setFieldValue("dense_tensor", new TensorFieldValue(tensor));
        }

        MapFieldValue<IntegerFieldValue, StringFieldValue> mval =
                new MapFieldValue<>((MapDataType)documents.get(1).getDocument().getField("mymap").getDataType());
        mval.put(new IntegerFieldValue(3), new StringFieldValue("a"));
        mval.put(new IntegerFieldValue(5), new StringFieldValue("b"));
        mval.put(new IntegerFieldValue(7), new StringFieldValue("c"));
        documents.get(1).getDocument().setFieldValue("mymap", mval);

        MapFieldValue<StringFieldValue, Array> amval =
                new MapFieldValue<>((MapDataType)documents.get(1).getDocument().getField("structarrmap").getDataType());
        amval.put(new StringFieldValue("foo"), aval);

        Array<Struct> abval = new Array<>(documents.get(1).getDocument().getField("structarray").getDataType());
        {
            Struct sval1 = new Struct(aval.getDataType().getNestedType());
            sval1.setFieldValue("key", new IntegerFieldValue(17));
            sval1.setFieldValue("value", new StringFieldValue("structval3"));
            Struct sval2 = new Struct(aval.getDataType().getNestedType());
            sval2.setFieldValue("key", new IntegerFieldValue(18));
            sval2.setFieldValue("value", new StringFieldValue("structval4"));
            abval.add(sval1);
            abval.add(sval2);
        }

        amval.put(new StringFieldValue("bar"), abval);
        documents.get(1).getDocument().setFieldValue("structarrmap", amval);

        WeightedSet<StringFieldValue> wsval = new WeightedSet<>(documents.get(1).getDocument().getField("stringweightedset").getDataType());
        wsval.add(new StringFieldValue("foo"));
        wsval.add(new StringFieldValue("val1"));
        wsval.add(new StringFieldValue("val2"));
        wsval.add(new StringFieldValue("val3"));
        wsval.add(new StringFieldValue("val4"));
        documents.get(1).getDocument().setFieldValue("stringweightedset", wsval);

        // Add empty array/struct to doc 2
        Struct sval3 = new Struct(documents.get(2).getDocument().getField("mystruct").getDataType());
        documents.get(2).getDocument().setFieldValue("mystruct", sval3);
        Array aval2 = new Array(documents.get(2).getDocument().getField("structarray").getDataType());
        documents.get(2).getDocument().setFieldValue("structarray", aval2);

        Array<IntegerFieldValue> intvals1 = new Array<>(documents.get(0).getDocument().getField("intarray").getDataType());
        intvals1.add(new IntegerFieldValue(12));
        intvals1.add(new IntegerFieldValue(40));
        intvals1.add(new IntegerFieldValue(60));
        intvals1.add(new IntegerFieldValue(84));
        documents.get(0).getDocument().setFieldValue("intarray", intvals1);

        Array<IntegerFieldValue> intvals2 = new Array<>(documents.get(1).getDocument().getField("intarray").getDataType());
        intvals2.add(new IntegerFieldValue(3));
        intvals2.add(new IntegerFieldValue(56));
        intvals2.add(new IntegerFieldValue(23));
        intvals2.add(new IntegerFieldValue(9));
        documents.get(1).getDocument().setFieldValue("intarray", intvals2);

        documents.get(8).getDocument().setFieldValue("truth", new BoolFieldValue(true));
        documents.get(9).getDocument().setFieldValue("truth", new BoolFieldValue(false));

        return documents;
    }
@author Simon Thoresen Hult
@author bratseth
document/src/test/java/com/yahoo/document/select/DocumentSelectorTestCase.java