Created
January 27, 2009 10:26
-
-
Save vrutberg/53272 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ----- SÅHÄR GÖR JAG NU ----- | |
while(doc != null) | |
{ | |
// söker i hela databasen varje gång | |
Document searchDoc = someDatabase.search("MYFIELD=\""+ doc.getItemValueString("MYFIELD") +"\"").getFirstDocument(); | |
// jobba med dokumentet... | |
doc = someView.getNextDocument(doc); | |
} | |
// ----- SÅHÄR VILL JAG GÖRA ----- | |
// söker i databasen en gång | |
DocumentCollection possibleDocs = someDatabase.search("MYFIELD!=\"\""); | |
while(doc != null) | |
{ | |
// och sedan söker jag i en docoumentcollection | |
Document searchDoc = possibleDocs.search("MYFIELD="\""+ doc.getItemValueString("MYFLEID") +"\"").getFirstDocument(); | |
// jobba med dokumentet... | |
doc = possibleDocs.getNextDocument(doc); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment