Forum Replies Created
- jnearsParticipant4 months ago in reply to: ACF Fields do not appear to be indexed #38243
Great
I really appreciate the speedy response to my questions!
Jonathan
jnearsParticipant4 months ago in reply to: ACF Fields do not appear to be indexed #38241Many thanks. This has worked.
Does adding the various boosts and applying the “Copy to a text field” option have any performance implications? I probably need to enable this for about 15 other ACF fields.
Thanks
jnearsParticipant5 months, 2 weeks ago in reply to: Search results header in custom search template #37270Hi
Is it also possible to grab the currently selected facet values (if any are chosen) and display them in the template?
Thanks
jnearsParticipant6 months, 1 week ago in reply to: Custom sorting for archive pages #36695Hi
This code does work, but I cannot use the ‘public’ keyword for the function. I’m not sure if this matters? If I add it, I get the following error: ‘Parse error: syntax error, unexpected token “public” ….’
Without the public keyword, the function is working; however, I’m getting the following message on the archive page: ‘Warning: Undefined variable $pubs_publication_date_str_asc’
I have tried activating this sort in the ‘Activate/deactivate items in the sort list’ but still get the error.
The error shows at the top of the page and where the widget filters sit.
My code:
use wpsolr\core\classes\WPSOLR_Events;
add_filter( WPSOLR_Events::WPSOLR_FILTER_DEFAULT_SORT, ‘wpsolr_filter_default_sort’, 10, 2 );
function wpsolr_filter_default_sort( $default_sort, $wpsolr_query ) {
if ( is_post_type_archive( ‘publication’ ) ) {
return $pubs_publication_date_str_asc;
}
return $default_sort;
}jnearsParticipant6 months, 1 week ago in reply to: Custom sorting for archive pages #36688Great
Thanks so much for the quick reply
JonathanjnearsParticipant6 months, 1 week ago in reply to: Custom sorting for archive pages #36679This makes some sense, but could you clarify if something like the below would work targeting a custom post-type archive of ‘publications’ and a sort I created within the WPSOLR admin called ‘publications_desc’
I’m not sure where/how the $my_sort in your example would be created.
use wpsolr\core\classes\WPSOLR_Events; add_filter( WPSOLR_Events::WPSOLR_FILTER_DEFAULT_SORT, 'wpsolr_filter_default_sort', 10, 2 ); function wpsolr_filter_default_sort( $default_sort, $wpsolr_query ) { if ( is_post_type_archive( 'publication' ) ) { return $publications_desc_sort; } return $default_sort; }
- This reply was modified 6 months, 1 week ago by jnears.
jnearsParticipant6 months, 1 week ago in reply to: Custom sorting for archive pages #36677I’m not sure this is granular enough for my needs?
I have a custom post type called ‘Publication’ with an archive page that uses WPSOLR. I need this archive default sort by a custom field (publication date).
I have a custom post type called ‘Variable’ with an archive page that uses WPSOLR. I need this archive default sort to be alphabetical.
WPSOLR allow the creation of views on pre-existing WordPress search or categories; however, it does not seem to allow views to be created on individual archive pages? I realise there is a check box to replace archives with WPSOLR results, but this doesn’t allow the granularity of targeting each archive differently?
Apologies if I’m incorrect on this.
If there is no way to set the sort order on individual archives, can I use code to intercept the Solr call somehow?
Thanks
jnearsParticipant6 months, 2 weeks ago in reply to: Facets items with certain characters in string do not filter content #36055Thank you. This worked well
jnearsParticipant6 months, 3 weeks ago in reply to: Facets items with certain characters in string do not filter content #35826Solr – https://opensolr.com/
jnearsParticipant6 months, 3 weeks ago in reply to: Facets items with certain characters in string do not filter content #35820I have also noticed that filters return no results when ‘and’ is in the string
e.g.
‘Incomes Benefits and Allowances’ – NO results
Changed ‘and’ to ‘&’
‘Incomes Benefits & Allowances’ – worksI must be able to use ‘and’ in the facet items
Please advise
ThanksjnearsParticipant6 months, 3 weeks ago in reply to: Facets items not filtering content and solr error on page refresh #35816I had left it blank (default), which the software says is 50. I changed to 30, and this appears to have resolved the issue, although I do need more than 30 to show. Why would this cause an issue, and can I up it to 50? Is this up to 50 facet items per filter, as some of our filters would have around 50 items and others maybe only 10?
jnearsParticipant4 years, 2 months ago in reply to: Return links to attachments rather than the post they are attached to #17468Currently they are all media library docs. Some are uploaded using advanced custom fields.
In the future we hope to index some documents outside of the wordpress media library (mainly for security).
jnearsParticipant4 years, 4 months ago in reply to: Solr results page error #15643Hi
Thanks this makes sense and so i created a new index and checked the files folder and they where different (i believe I dad the default solr files not the correct wp solr ones).
I just changed my existing index config in wordpress to point to the new index with the correct config files then re-indexed it and all seem to be working correctly
thanks for the help
Jon
jnearsParticipant4 years, 4 months ago in reply to: Solr results page error #15641Hi
I think this is all configured properly. When im on the main WP Solr index page it goes green and says connection is successful.
The index is visible in the solr admin dashboard and corresponds to the same amount of posts/pages indexed to what WP Solr is reporting.
I have tried deleting all the content and only adding one content type to the index (FAQ custom post type of which there are only 30)
When i visit the results page it say at the top 30 records are indexed but the page lists results incorrectly
Showing 1 to 20 results out of 30
Array
…
By Array, on 01/01/1970, 1 commentsArray
…
By Array, on 01/01/1970, 1 commentsI have tried disabling a few custom plugins, changing permalink structure and also applied a different theme.
I’m using MAMP pro – not sure if this would make a difference?
The only other thing i could try is a new vanilla instance of WordPress with a few basic pages and WP solr?
Thanks
Jon
jnearsParticipant5 years, 2 months ago in reply to: User search #10239Thanks for your reply
Is it possible in WordPress to automate (scheduled task) the extraction of data from some of the User fields into a custom (staff) post type for each user? If we could do this i guess the plugin could search the content of those pages?