<commit_before>package org.xcolab.portlets.search;

import com.liferay.portal.kernel.search.Document;
import org.xcolab.client.search.pojo.SearchPojo;
import org.xcolab.portlets.search.items.AbstractSearchItem;
import org.xcolab.portlets.search.items.BlogSearchItem;
import org.xcolab.portlets.search.items.ContentSearchItem;
import org.xcolab.portlets.search.items.ContestSearchItem;
import org.xcolab.portlets.search.items.DiscussionSearchItem;
import org.xcolab.portlets.search.items.ProposalSearchItem;
import org.xcolab.portlets.search.items.UserSearchItem;
import org.xcolab.portlets.search.paging.PageLinkWrapper;

public enum SearchItemType {

    PLAN(1368503l,new String[]{"entryClassName", "com.ext.portlet.model.Proposal"},
            new String[]{"content", "title", "pitch", "sections"}, ProposalSearchItem.class),

    CONTEST(39701l,new String[]{"entryClassName", "com.ext.portlet.model.Contest"},
            new String[]{"content", "title"}, ContestSearchItem.class),

    USER(10038l,new String[]{"entryClassName", "com.liferay.portal.model.User"},
            new String[]{"screenName", "firstName", "lastName"}, UserSearchItem.class),

    CONTENT(1l,new String[]{"entryClassName",
            "com.liferay.portlet.wiki.model.* OR com.liferay.portlet.journal.model.JournalArticle"},
            new String[]{"title"}, ContentSearchItem.class),

    BLOG(2l,new String[]{"entryClassName", "com.liferay.portlet.blogs.model.*"},
            new String[]{"title", "content"}, BlogSearchItem.class),

    DISCUSSION(39202l,new String[]{"entryClassName", "com.ext.portlet.model.DiscussionMessage"},
            new String[]{"title", "content"}, DiscussionSearchItem.class);

    private Long id;
    private final String[] determinatorFieldValue;
    private final String[] searchFields;
    private final Class<? extends AbstractSearchItem> searchItemClass;

    SearchItemType(Long id, String[] determinatorInfo, String[] searchFields,
            Class<? extends AbstractSearchItem> searchItemClass) {
        this.searchItemClass = searchItemClass;
        if (determinatorInfo.length != 2) {
            throw new IllegalArgumentException("Determinator info table needs to have 2 values");
        }
        this.determinatorFieldValue = determinatorInfo;
        this.searchFields = searchFields;
        this.id = id;
    }

    public String getQuery(String userQuery) {
        StringBuilder sb = new StringBuilder();<commit_msg>changes for search types not implemented - commented out because we may use them in the future<commit_after>package org.xcolab.portlets.search;

import com.liferay.portal.kernel.search.Document;
import org.xcolab.client.search.pojo.SearchPojo;
import org.xcolab.portlets.search.items.AbstractSearchItem;
import org.xcolab.portlets.search.items.BlogSearchItem;
import org.xcolab.portlets.search.items.ContentSearchItem;
import org.xcolab.portlets.search.items.ContestSearchItem;
import org.xcolab.portlets.search.items.DiscussionSearchItem;
import org.xcolab.portlets.search.items.ProposalSearchItem;
import org.xcolab.portlets.search.items.UserSearchItem;
import org.xcolab.portlets.search.paging.PageLinkWrapper;

public enum SearchItemType {

    PLAN(1368503l,new String[]{"entryClassName", "com.ext.portlet.model.Proposal"},
            new String[]{"content", "title", "pitch", "sections"}, ProposalSearchItem.class),

    CONTEST(39701l,new String[]{"entryClassName", "com.ext.portlet.model.Contest"},
            new String[]{"content", "title"}, ContestSearchItem.class),

    USER(10038l,new String[]{"entryClassName", "com.liferay.portal.model.User"},
            new String[]{"screenName", "firstName", "lastName"}, UserSearchItem.class),
/*
    CONTENT(1l,new String[]{"entryClassName",
            "com.liferay.portlet.wiki.model.* OR com.liferay.portlet.journal.model.JournalArticle"},
            new String[]{"title"}, ContentSearchItem.class),

    BLOG(2l,new String[]{"entryClassName", "com.liferay.portlet.blogs.model.*"},
            new String[]{"title", "content"}, BlogSearchItem.class),
*/
    DISCUSSION(39202l,new String[]{"entryClassName", "com.ext.portlet.model.DiscussionMessage"},
            new String[]{"title", "content"}, DiscussionSearchItem.class);

    private Long id;
    private final String[] determinatorFieldValue;
    private final String[] searchFields;
    private final Class<? extends AbstractSearchItem> searchItemClass;

    SearchItemType(Long id, String[] determinatorInfo, String[] searchFields,
            Class<? extends AbstractSearchItem> searchItemClass) {
        this.searchItemClass = searchItemClass;
        if (determinatorInfo.length != 2) {
            throw new IllegalArgumentException("Determinator info table needs to have 2 values");
        }
        this.determinatorFieldValue = determinatorInfo;
        this.searchFields = searchFields;
        this.id = id;
    }

    public String getQuery(String userQuery) {
        StringBuilder sb = new StringBuilder();
{'fraction_non_alphanumeric': 0.12637692769877829, 'fraction_numerical': 0.010414580412577609, 'mean_word_length': 4.312765957446809, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '3113824', 'n_tokens_mistral': 1473, 'n_tokens_neox': 1422, 'n_words': 268}