001 /** 002 * Copyright (c) 2000-present Liferay, Inc. All rights reserved. 003 * 004 * This library is free software; you can redistribute it and/or modify it under 005 * the terms of the GNU Lesser General Public License as published by the Free 006 * Software Foundation; either version 2.1 of the License, or (at your option) 007 * any later version. 008 * 009 * This library is distributed in the hope that it will be useful, but WITHOUT 010 * ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS 011 * FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more 012 * details. 013 */ 014 015 package com.liferay.portal.kernel.search; 016 017 /** 018 * @deprecated As of 7.0.0 , replaced by {@link 019 * com.liferay.portal.kernel.search.generic.TermQueryImpl} 020 * 021 * @author Brian Wing Shun Chan 022 * @author Michael C. Han 023 * @author Raymond Aug?? 024 */ 025 @Deprecated 026 public class TermQueryFactoryUtil { 027 028 public static TermQuery create( 029 SearchContext searchContext, String field, long value) { 030 031 return getTermQueryFactory(searchContext).create(field, value); 032 } 033 034 public static TermQuery create( 035 SearchContext searchContext, String field, String value) { 036 037 return getTermQueryFactory(searchContext).create(field, value); 038 } 039 040 public static TermQueryFactory getTermQueryFactory( 041 SearchContext searchContext) { 042 043 String searchEngineId = searchContext.getSearchEngineId(); 044 045 SearchEngine searchEngine = SearchEngineUtil.getSearchEngine( 046 searchEngineId); 047 048 return searchEngine.getTermQueryFactory(); 049 } 050 051 }