com.mindoo.domino.jna.internal.FTSearchResultsDecoder Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of domino-jna Show documentation
Show all versions of domino-jna Show documentation
Java project to access the HCL Domino C API using Java Native Access (JNA)
package com.mindoo.domino.jna.internal;
import java.util.ArrayList;
import java.util.EnumSet;
import java.util.List;
import com.mindoo.domino.jna.NoteIdWithScore;
import com.mindoo.domino.jna.constants.FTSearch;
import com.sun.jna.Pointer;
public class FTSearchResultsDecoder {
public static List decodeNoteIdsWithStoreSearchResult(Pointer ptr,
EnumSet searchOptions) {
int numHits = ptr.getInt(0);
ptr = ptr.share(4);
short flags = ptr.getShort(0);
ptr = ptr.share(2);
if ((flags & NotesConstants.FT_RESULTS_EXPANDED) == NotesConstants.FT_RESULTS_EXPANDED) {
throw new IllegalArgumentException("Domain searches are currently unsupported");
}
if ((flags & NotesConstants.FT_RESULTS_URL) == NotesConstants.FT_RESULTS_URL) {
throw new IllegalArgumentException("FT results with URL are currently unsupported");
}
short varLength = ptr.getShort(0);
ptr = ptr.share(2);
List noteIds = new ArrayList();
List scores = new ArrayList();
for (int i=0; i noteIdsWithScore = new ArrayList();
for (int i=0; i