Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- private static Document buildDocument(SiteProduct siteProduct) {
- Document doc = new Document();
- IndexableField siteProductIdF = new LongField("siteProductId",
- siteProduct.getSiteProductId(), Field.Store.YES);
- IndexableField siteIdF = new IntField("siteId",
- siteProduct.getSiteId(), Field.Store.YES);
- IndexableField nameF = new StringField("name",
- siteProduct.getName(), Field.Store.NO);
- IndexableField categoryF = new StringField("category",
- StringUtils.lowerCase(siteProduct.getCategory()), Field.Store.YES);
- doc.add(siteProductIdF);
- doc.add(siteIdF);
- doc.add(nameF);
- doc.add(categoryF);
- //((Field) doc.getField(siteProductIdField.name())).setStringValue(siteProduct.getSiteProductId().toString());
- //((Field) doc.getField(siteIdField.name())).setStringValue(siteProduct.getSiteId().toString());
- //((Field) doc.getField(nameField.name())).setStringValue(siteProduct.getName());
- //((Field) doc.getField(categoryField.name())).setStringValue(StringUtils.lowerCase(siteProduct.getCategory()));
- return doc;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement