solar query not giving data when using profilefield

Hi all,

i am running the below code at my community

#set($query = "type:user && profile_type:ABC" )

 #set($results = $core_v2_searchResult.List("%{ Query = $query}"))


there are lots of record that contain ABC value in profile field "type" but i am getting constant data ,even though when i am creating a new user with profile file type having value ABC but count is not increasing.

  • Note that in the query text && is not the same as AND. You probably want type:user AND profile_type:ABC. That's not the issue here but worth noting.

    Have you run that query directly against Solr? Do you get the expected results? Since you mentioned ABC is on all of them I would expect the results to grow as well. If you look at the 'timestamp' field directly in the search index it will tell you when the record was indexed. Maybe the user wasnt updated in search/solr yet?

    Also, if you are building a feature that will be re-used (vs just poking around for results), move the 'type:user' to a filter (Filter property on the query) so search will cache the filter results. The "type:user" filter is a great candidate to be cached. 

  • thanks for your valuable reply ,

    "If you look at the 'timestamp' field directly in the search index"

    how can i check this ?

  • You can use the script sandbox. Type your query/velocity (ex: $core_v2_searchResult.List("%{Filters = 'type::user', Query = 'test' }")) ) and look for the 'IndexedAt' field on the results.

Reply Children
No Data