Permalink
Browse files

LPS-25152 Organizations are viewable across portal instances for Solr

  • Loading branch information...
1 parent 705e6fb commit b56feb05220ad6a1d6e86fd72eb1aa2f5fa33641 @matthewkong matthewkong committed with hhuijser Jan 31, 2012
View
11 webs/solr-web/docroot/WEB-INF/src/com/liferay/portal/search/solr/SolrIndexSearcherImpl.java
@@ -38,6 +38,7 @@
import com.liferay.portal.kernel.search.facet.config.FacetConfiguration;
import com.liferay.portal.kernel.util.ArrayUtil;
import com.liferay.portal.kernel.util.GetterUtil;
+import com.liferay.portal.kernel.util.StringBundler;
import com.liferay.portal.kernel.util.StringPool;
import com.liferay.portal.kernel.util.StringUtil;
import com.liferay.portal.kernel.util.Time;
@@ -342,6 +343,14 @@ protected SolrQuery translateQuery(
String queryString = query.toString();
+ StringBundler sb = new StringBundler(queryString);
+
+ sb.append(StringPool.SPACE);
+ sb.append(StringPool.PLUS);
+ sb.append(Field.COMPANY_ID);
+ sb.append(StringPool.COLON);
+ sb.append(companyId);
+
QueryConfig queryConfig = query.getQueryConfig();
SolrQuery solrQuery = new SolrQuery();
@@ -350,7 +359,7 @@ protected SolrQuery translateQuery(
solrQuery.setHighlightFragsize(queryConfig.getHighlightFragmentSize());
solrQuery.setHighlightSnippets(queryConfig.getHighlightSnippetSize());
solrQuery.setIncludeScore(queryConfig.isScoreEnabled());
- solrQuery.setQuery(queryString);
+ solrQuery.setQuery(sb.toString());
if ((start == QueryUtil.ALL_POS) && (end == QueryUtil.ALL_POS)) {
solrQuery.setRows(0);

0 comments on commit b56feb0

Please sign in to comment.