Chapter 2 - useFacets: true

Hello,

I’m trying to complete the Faceted Search ticket, but looks like when adding “useFacets” to my index.html, it doens’t produce any effect in the application… anyway I pass the test and get the code validation, but the behavior of the app is the same as before, no changes in the search… Thanks

Hi @Jose_Luis_28345,

Give me some time to test this issue on my local system.

Kanika

Hi @Jose_Luis_28345,

Have you tried to hard refresh your browser ?

Browsers have this bad habit of caching JS code, and that might be the cause for this.

N.

Yes, I did it many times, also I open it in a private window… not working, I just add:

<script>
    useFacets = true
</script>

in the index.html file

I also tried (as I read in the JS course):

<script>
    mflix.useFacets = true
</script>

But not working

I have also completed the test but I am not able make it work on UI. As I am not sure where to add useFacet : true on index.html. if it is working for anyone could you please provide proper instruction where to add this to enable facet search on UI.

Same issue happens to me. Tried in three browsers but all the same result

Faced same problem. I wish documented can be updated.

I have the same issue. I can’t enable that option.

This html change presumes some knowledge of JavaScript which I have a little bit.

You can add another script block anywhere in the title or body.

<script> my script here </script>

mflix is a top level variable. If I had a top level variable called foo in a web page I could assign to it like window.foo=

You’re assigning an object which in JavaScript can look like
{ name : value } where value could be many things including primitives like numbers and Booleans (true or false).

This gives you:

<script>window.foo={name : value}</script>

Plug in the information given in the ticket. This worked for me.

1 Like

None of the proposals listed here work for me, as far as I can tell. There is no change to the search screen, but nothing says where the changes should appear nor what they will be.
@Kanika can you give us a clue? Thanks!

Hi @JoshEisenberg,

The changes will appear when you select Cast in the search parameter and after you click enter, there will be new search appearing on the main screen.

Currently I am working on adding a screenshot in the ticket for better understanding.

Meanwhile, let me know if you are having issue with implementing the ticket.

Kanika

Hi @Kanika

Yes, it works for me! I get a new screen with Rating and Runtime buckets, but when I click on an entry there it just spins. I have screenshots if you’d like.

Thanks,

Josh

HI @Kanika,

I added script “window.mflix = {useFacets: true}”, and I found “mflix.useFacets” via the console, and then I selected cast. And a black screen with spin is what I have:

Screenshot

P.S. I have the validation code and tests passed

Hi @JoshEisenberg,

Yes, please share screenshots. Currently blank search is not working. But Rating search should have worked.

@tsimbaland,

Can you try without script code?

Kanika

@Kanika,
The same. I pressed the search button, then panel appeared on the left, I chose “cast” and clicked enter (or “Search” button).

Am I doing it wrong?

Hi @tsimbaland,

That is a bug actually. We are handling it and will push the changes in few days.

Try searching for “Tom Hanks” or “Morgan Freeman” and select Cast. You will be able to see results.

Kanika