ExpressionEngine CMS
Open, Free, Amazing

Thread

This is an archived forum and the content is probably no longer relevant, but is provided here for posterity.

The active forums are here.

Search

May 22, 2013 4:51am

Subscribe [3]
  • #1 / May 22, 2013 4:51am

    somvannda

    37 posts

    How do I get the search result by looping everything in database and retrieve the result as match data?

    Thanks

  • #2 / May 22, 2013 11:53am

    Boyink!

    5011 posts

    Are using the built-in search module?

  • #3 / May 22, 2013 9:45pm

    somvannda

    37 posts

    Yeah i want to use the built-in search module, but have no idea how to kick off to use that. Any instruction to read? A little bit details. Thanks

  • #4 / May 22, 2013 11:02pm

    Boyink!

    5011 posts

    You’ve read the docs, I assume?

  • #5 / May 23, 2013 12:41am

    somvannda

    37 posts

    yeah, but not so understanding how to implement it :(

  • #6 / May 23, 2013 11:30am

    Boyink!

    5011 posts

    Basically:

    - Make sure fields are searchable (each one has a yes/no setting).
    - Create a results template to display results
    - Create a no results template to show a message when no results
    - Put the simple search form somewhere on your site, configuring it to point to your templates and telling it what channels to search in.

  • #7 / May 24, 2013 9:28am

    Alam71

    19 posts

    Hi Boyink!
    Thanks for your instruction by step by step .Thank you for useful information. It is exactly what I needed. I managed to get here everything that I need for my site. Applause for a author!

  • #8 / May 24, 2013 9:38am

    Boyink!

    5011 posts

    Cheers!

  • #9 / May 25, 2013 8:56am

    somvannda

    37 posts

    Hi Boyink,

    Is there any way to search all channels not just a specific channels? When it comes to search it would be useful to search every channel entries right?

    Thanks

  • #10 / May 25, 2013 9:43am

    Boyink!

    5011 posts

    Just specify all your channels.

    For me there always seem to be some channels that it doesn’t make sense to search.

    Plus each channel needs a search results URL defined as well so the search result links are pointed correctly.

  • #11 / May 27, 2013 12:46am

    somvannda

    37 posts

    Hi boyink!,

    Your help was very helpful, I did get all the result from every channels we mentioned and not every channels are put into search. You were right.

    So here is my code to display the search result

    {exp:search:search_results}
      <div class=“search-result”>
                    <h2 class=“headerRegular”>{title}</h2>
                   
                    {full_text}
                   
                    Content type: Press release
      </div>

    {/exp:search:search_results}

    The problem is that I could not get the real link of the results.

    The link it generated is something like this http://localhost/ticambodia.org/index.php/youth-camp-empowering-young-people-to-demand-for-transparency-and-integrity. actually, I have them running on real webhosting already, but it still showing the localhost.

    Any ideas?

    Thanks

  • #12 / May 27, 2013 12:47pm

    Boyink!

    5011 posts

    How are you building the link? I don’t see it in your code.

  • #13 / May 27, 2013 10:05pm

    somvannda

    37 posts

    {exp:search:search_results}
       <div class="search-result">
                            <h2 class="headerRegular"><a href="http://{if">{title}</a></h2>
                            
                            {full_text}
                            
                            <span class="headerRegular">Content type:</span> Press release
       </div>
    
    {/exp:search:search_results}

    Here it is

  • #14 / May 28, 2013 10:41am

    Boyink!

    5011 posts

    Have you looked to see how auto_path is populated?

  • #15 / May 29, 2013 4:57am

    somvannda

    37 posts

    <a href="http://localhost/ticambodia.org/index.php/youth-camp-empowering-young-people-to-demand-for-transparency-and-integrity">http://localhost/ticambodia.org/index.php/youth-camp-empowering-young-people-to-demand-for-transparency-and-integrity</a>

    Here is what i got. and the title is Youth Camp Empowering Young People to Demand for Transparency and Integrity. When the actually title is not that.

    I want it to search all the title of each channel entries where I wanted to search and the content of its, but some channel entries has different channel fields. But I think there will be a trick to grab all titles, contents and links from the actual channel entries.

    Thanks

.(JavaScript must be enabled to view this email address)

ExpressionEngine News!

#eecms, #events, #releases