Forum Replies Created

  • jnears
    Participant

    Great

    I really appreciate the speedy response to my questions!

    Jonathan

    jnears
    Participant

    Many 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

    jnears
    Participant
    5 months, 2 weeks ago in reply to: Search results header in custom search template #37270

    Hi

    Is it also possible to grab the currently selected facet values (if any are chosen) and display them in the template?

    Thanks

    jnears
    Participant
    6 months, 1 week ago in reply to: Custom sorting for archive pages #36695

    Hi

    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;
    }

    jnears
    Participant
    6 months, 1 week ago in reply to: Custom sorting for archive pages #36688

    Great
    Thanks so much for the quick reply
    Jonathan

    jnears
    Participant
    6 months, 1 week ago in reply to: Custom sorting for archive pages #36679

    This 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.
    jnears
    Participant
    6 months, 1 week ago in reply to: Custom sorting for archive pages #36677

    I’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

    jnears
    Participant

    Thank you. This worked well

    jnears
    Participant
    jnears
    Participant

    I 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’ – works

    I must be able to use ‘and’ in the facet items

    Please advise
    Thanks

    jnears
    Participant

    I 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?

    jnears
    Participant

    Currently 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).

    jnears
    Participant
    4 years, 4 months ago in reply to: Solr results page error #15643

    Hi

    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

    jnears
    Participant
    4 years, 4 months ago in reply to: Solr results page error #15641

    Hi

    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 comments

    Array

    By Array, on 01/01/1970, 1 comments

    I 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

    jnears
    Participant
    5 years, 2 months ago in reply to: User search #10239

    Thanks 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?

Viewing 15 posts - 1 through 15 (of 15 total)